View source: R/ggstrat-labels.R
label_geochem | R Documentation |
Geochem facet labelers
label_geochem( labels, units = character(0), default_units = NA_character_, geochem_facet = 1, renamers = c(`^d([0-9]+)([HCNOS])$` = "paste(delta ^ \\1, \\2)", `^210Pb$` = "paste({}^210, Pb)", `^Pb210$` = "paste({}^210, Pb)"), multi_line = TRUE )
labels |
A data.frame of facet label values |
units |
A named list of values = unit |
default_units |
The default units to apply |
geochem_facet |
Which facet to apply formatting |
renamers |
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. |
multi_line |
See label_parsed |
A ggplot2::labeller()
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)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.