count_taxa | R Documentation |
Counting number of taxa within taxlist objects or character vectors containing taxon names.
count_taxa(object, data, ...)
## S4 method for signature 'character,missing'
count_taxa(object, na.rm = TRUE, ...)
## S4 method for signature 'factor,missing'
count_taxa(object, na.rm = TRUE, ...)
## S4 method for signature 'taxlist,missing'
count_taxa(object, level, ...)
## S4 method for signature 'formula,taxlist'
count_taxa(object, data, include_na = FALSE, suffix = "_count", ...)
object |
An object containing a taxonomic list or a formula. |
data |
An object of class taxlist in the |
... |
further arguments passed among methods. |
na.rm |
Logical value, whether NAs have to be removed from the input vector or not. |
level |
Character value indicating the taxonomic rank of counted taxa. |
include_na |
Logical value indicating whether |
suffix |
Character value used as suffix for the counted rank in the
output data frame (only used in |
This function is written by convenience in order to reduce code for counting
taxa within taxlist objects and it is just a wrapper of length()
.
An integer with the number of taxa.
Miguel Alvarez kamapu78@gmail.com
## factor method
count_taxa(iris$Species)
## taxlist method
count_taxa(Easplist)
## count only species
count_taxa(Easplist, level = "species")
## using a formula
count_taxa(~life_form, Easplist, include_na = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.