taxa2samples | R Documentation |
For statistical purposes it may be necessary to insert information on recorded taxa into the slot samples, which contain the records of taxa in sampling plots. This can be also done selectivelly for specific taxonomic ranks and lower ranks can be aggregated to their parental ones.
If column TaxonConceptID is already existing in 'objec@samples'
,
this column will get overwritten, retrieving a warning message.
taxa2samples(object, ...)
## S3 method for class 'vegtable'
taxa2samples(
object,
merge_to,
include_levels,
add_relations = FALSE,
add_traits = FALSE,
...
)
object |
A vegtable object. |
... |
Further arguments passed among methods. |
merge_to |
Character value indicating the level (taxonomic rank) to which taxa of lower rank have to be merged. |
include_levels |
Character vector indicating the levels to be considered in the output object. This will set the values of TaxonConceptID and any respective values inserted from slots taxonRelations and taxonTraits as NA. |
add_relations |
A logical value indicating whether the content of slot taxonRelations have to be inserted in slot samples or not. |
add_traits |
A logical value indicating whether the content of slot taxonTraits have to be inserted in slot samples or not. |
An object of class vegtable.
Miguel Alvarez kamapu78@gmail.com
## Add only variable TaxonConceptID
veg <- taxa2samples(Kenya_veg)
head(veg@samples)
## Add also information from slots taxonRelations and taxonTraits
veg <- taxa2samples(Kenya_veg, add_relations = TRUE, add_traits = TRUE)
head(veg@samples)
## Different ranks recorded at samples
veg <- taxa2samples(Kenya_veg, add_relations = TRUE)
summary(veg@samples$Level)
## Aggregate taxa to family level
veg <- taxa2samples(Kenya_veg, add_relations = TRUE, merge_to = "family")
summary(veg@samples$Level)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.