species_richness: Calculate Number of Species

View source: R/fqi_metrics.R

species_richnessR Documentation

Calculate Number of Species

Description

species_richness calculates the total number of species.

Usage

species_richness(x, key = "name", db, native = FALSE, allow_no_c = TRUE)

Arguments

x

A data frame containing a list of plant species. This data frame must have one of the following columns: name or acronym. For cover-weighted or relative functions, this data frame must also have a column called cover containing cover values and ideally a column containing plot IDs.

key

A character string representing the column that will be used to join the input data frame x with the regional FQA database. If a value is not specified, the default is "name". "name" and "acronym" are the only acceptable values for key.

db

A character string representing the regional FQA database to use. See db_names for a list of potential values and the fqadata R package where the databases are hosted.

native

Boolean (TRUE or FALSE). If TRUE, calculate metrics using only native species.

allow_no_c

Boolean (TRUE or FALSE). If TRUE, allow species that are found in the regional FQA database but have not been assigned a C Values. If FALSE, omit species that have not been assigned C Values.

Value

A non-negative integer

Examples

plant_list <- crooked_island

#number of species (native and introduced)
species_richness(x = plant_list, key = "acronym", db = "michigan_2014", native = FALSE)

#number of native species
species_richness(x = plant_list, key = "acronym", db = "michigan_2014", native = TRUE)

fqacalc documentation built on Sept. 26, 2023, 5:10 p.m.