add_species_stat: Species statistics of 'nodiv' data objects

View source: R/Add_to_data_object.R

species_statR Documentation

Species statistics of nodiv data objects

Description

Adds, or reads species statistics from objects in the nodiv package

Usage

add_species_stat(distrib_data, species_stat, specs = NULL)
species_stat(distrib_data, statname = NULL, specs = NULL)

Arguments

distrib_data

An object of type distrib_data, nodiv_data or nodiv_result

species_stat

A species statistic, such as body size or cold tolerance. This can be a vector or a data.frame. If specs is not specified, the function tries to match species_stat to the site names of the distrib_data object. The function looks for vector names, rownames, or variables in the data.frame that match the species names. If species names are absent and the number of species_stats match, the species_stat is assumed to be in the correct order.

specs

A character or numeric variable specifying the species of interest, or for which species_stat is specified

statname

The name of a species statistic in the distrib_data object. If statname is not given, a list of names of species statistics is given

Value

add_species_stat returns the object with the new species_stat inside. species_stat returns the named sitestatistic.

Author(s)

Michael Krabbe Borregaard

See Also

distrib_data


nodiv documentation built on Aug. 21, 2023, 9:10 a.m.