biodiversity | R Documentation |
This function creates a simple data structure to hold biodiversity data, including taxa occurrence data, data about the sites or samples that the taxa were observed at, data on the traits of the taxa observed, and a phylo4 object (from the phylobase package) containing the taxa phylogeny.
biodiversity( sample, taxon, count, site = NULL, site.data = NULL, trait = NULL, trait.data = NULL, phylo = NULL ) ## S3 method for class 'biodiversity' getSamples(x, pa = F, ...) ## S3 method for class 'biodiversity' getSites(x, ...) ## S3 method for class 'biodiversity' getSites(x, ...) ## S3 method for class 'biodiversity' getTraits(x, ...) ## S3 method for class 'biodiversity' print(x, ...)
sample |
a site/sample identifier describing the unit of data collection for the study. |
taxon |
a taxon identfier that uniquely describes each taxon. |
count |
a vector of counts of individuals |
site |
a two sided formula describing the site data to use. The left
hand side should contain the site/sample identifiers that match the
|
site.data |
a data.frame containing site data |
trait |
a two sided formula describing the traits to store from the
|
trait.data |
a data.frame containing trait data |
phylo |
a phylo4 object containing a phylogeny for the the taxa present in the taxon variable |
x |
a |
pa |
logical; if T presence absence data is returned rather than counts |
Many R packages and functions for phylogenetic or diversity analyses require the data to be in formats something like these. This function ensures that the taxa and sites match among all the elements and provides warnings (or errors in some cases) if they don't.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.