This function calculates the summed land area of all of the geographic feature a taxonomic clade(s) occupies.

clade_area(
  data,
  area,
  geo_group,
  taxa_group,
  status,
  stat_levels = unique(data[, status])
)

Arguments

data

A data frame that holds the species occurrence data with at least 4 columns of factors that holds the geographic groups, taxonomic groups, species statuses, and species binomial names.

area

A data frame with two columns. The first has to be the names of the geographic features used in data and the second the area for those geographic features.

geo_group

A character equal to the column name in which the geographic groups are stored (e.g. bank names)

taxa_group

A character or vector equal to the column name(s) in which the names of the taxonomic groups are stored (e.g. genus and/or family names)

status

A character equal to the column name in which the species' statuses are stored

stat_levels

A character or vector equal to the levels of the interest of the species' status column. The default is to use all of the levels in the species' status column of the data.

Value

A data frame with two columns. The first column will hold the clade names and the second column the area of bank occupancy in the units of the area data frame.

Examples

if (FALSE) {
clade.area <- clade_area(data = herp,
                         area = bnk.area,
                         geo_group = 'bank',
                         taxa_group = c('Class', 'Order', 'Suborder', 'Family', 'Genus'),
                         status = 'bnk_status',
                         stat_levels = c("N", "E"))

}