abundPlots: Make taxonomic abundance plot

View source: R/abundPlots.R

abundPlotsR Documentation

Make taxonomic abundance plot

Description

Function to make bee taxonomic abundance plots (species, genus, family level counts) from data frame.

Usage

abundPlots(
  d,
  family = family,
  genus = genus,
  species = NULL,
  genSpp = NULL,
  colourSet = "Set1",
  scaleYtext = c(1, 1, 1),
  keepSpp = TRUE,
  returnPlots = FALSE
)

Arguments

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 makeGenSpp)

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)

Value

A ggarrange (ggplot) object, showing bee abundances split up by species, genus, and family

Examples

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)

samuelVJrobinson/SRtools documentation built on Nov. 11, 2024, 12:37 p.m.