Use these to label species with partial italic formatting. See label_parsed.

label_species(
  labels,
  dont_italicize = c("\\(.*?\\)", "spp?\\.", "-complex", "[Oo]ther"),
  species_facet = 1,
  multi_line = TRUE
)

Arguments

labels

A data.frame of facet label values

dont_italicize

Regular expressions that should not be italicized

species_facet

Which facet(s) contain species values

multi_line

See label_parsed

Examples


library(ggplot2)

ggplot(keji_lakes_plottable, aes(x = rel_abund, y = depth)) +
  geom_col_segsh() +
  scale_y_reverse() +
  facet_grid(
    cols = vars(taxon),
    rows = vars(location),
    scales = "free_x",
    space = "free_x",
    labeller = purrr::partial(label_species, species_facet = "taxon")
  ) +
  labs(y = "Depth (cm)")