abundPlots | R Documentation |
Function to make bee taxonomic abundance plots (species, genus, family level counts) from data frame.
abundPlots(
d,
family = family,
genus = genus,
species = NULL,
genSpp = NULL,
colourSet = "Set1",
scaleYtext = c(1, 1, 1),
keepSpp = TRUE,
returnPlots = FALSE
)
d |
Data frame or tibble |
family |
Family column |
genus |
Genus column |
species |
Species column - can also use genSpp column (see below) |
genSpp |
GenSpp column (optional - create using |
colourSet |
Colour set from ColourBrewer (default = "Set1") |
scaleYtext |
Scaling factor for y-axis text (default = c(1,1,1)) |
keepSpp |
Keep morphospecies? (default = TRUE) |
returnPlots |
Should plots be returned in a list instead? (default = FALSE) |
A ggarrange
(ggplot
) object, showing bee abundances split up by species, genus, and family
dat <- data.frame(f=c('Apidae','Apidae','Apidae','Colletidae','Andrenidae','Andrenidae'),
g=c('Bombus','Bombus','Apis','Hylaeus','Lasioglossum','Lasioglossum'),
s=c('rufocinctus','rufocinctus','mellifera','annulatus','zonulum','spp.'))
abundPlots(dat,f,g,s,keepSpp=FALSE)
abundPlots(dat,f,g,s,keepSpp=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.