Geochem facet labelers
A data.frame of facet label values
A named list of values = unit
The default units to apply
Which facet to apply formatting
Search and replace operations to perform in the form search = replace. Replace text can (should) contain backreferences, and will be parsed as an expression (see plotmath). Use NULL to suppress renaming.
See label_parsed
library(ggplot2)
ggplot(alta_lake_geochem, aes(x = value, y = depth)) +
geom_lineh() +
geom_point() +
scale_y_reverse() +
facet_wrap(
vars(param),
labeller = purrr::partial(label_geochem, geochem_facet = "param"),
nrow = 1,
scales = "free_x"
) +
labs(x = NULL, y = "Depth (cm)")