count_taxa | R Documentation |
Counting number of taxa within taxlist objects or character vectors containing taxon names.
This function provides a quick calculation of taxa in vegtable objects, considering only records in slot samples. Such records can be also merged from lower ranks.
For the formula method, units without any requested taxa will not appear in the output data frame. If no taxa at all is occurring at the requested level in any unit, an error message will be retrieved.
## S4 method for signature 'vegtable,missing'
count_taxa(object, level, include_lower = FALSE, ...)
## S4 method for signature 'formula,vegtable'
count_taxa(
object,
data,
include_lower = FALSE,
suffix = "_count",
in_header = TRUE,
...
)
count_taxa(data, ...) <- value
## S4 replacement method for signature 'vegtable,formula'
count_taxa(data, ...) <- value
object |
An object of class vegtable or a formula. |
level |
Character value indicating the taxonomic rank of counted taxa. |
include_lower |
Logical value, whether lower taxonomic ranks should be included at the requested level. |
... |
further arguments passed among methods. |
data |
An object of class vegtable. |
suffix |
Character value used as suffix on the calculated variable. |
in_header |
Logical value, whether the result should be included in the slot header of the input vegtable object or not. If the formula term is related to a categorical variable at header, the result will be inserted in the respective table at slot relations. |
value |
A formula passed to parameter 'object' by the replace method. |
An data frame with the number of taxa from requested level at requested units for the formula method, or just an integer value.
Miguel Alvarez kamapu78@gmail.com
## Different alternatives
count_taxa(Kenya_veg)
head(count_taxa(~ReleveID, Kenya_veg, in_header = FALSE))
head(count_taxa(species ~ ReleveID, Kenya_veg, in_header = FALSE))
head(count_taxa(species ~ ReleveID, Kenya_veg, TRUE, in_header = FALSE))
head(count_taxa(family ~ ReleveID, Kenya_veg, TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.