powered by
Counting number of taxa within taxlist objects or character vectors containing taxon names.
count_taxa(object, data, ...)# S4 method for character,missing count_taxa(object, na.rm = TRUE, ...)# S4 method for factor,missing count_taxa(object, na.rm = TRUE, ...)# S4 method for taxlist,missing count_taxa(object, level, ...)# S4 method for formula,taxlist count_taxa(object, data, include_na = FALSE, suffix = "_count", ...)
# S4 method for character,missing count_taxa(object, na.rm = TRUE, ...)
# S4 method for factor,missing count_taxa(object, na.rm = TRUE, ...)
# S4 method for taxlist,missing count_taxa(object, level, ...)
# S4 method for formula,taxlist count_taxa(object, data, include_na = FALSE, suffix = "_count", ...)
An integer with the number of taxa.
An object containing a taxonomic list or a formula.
An object of class taxlist in the formula method.
formula
further arguments passed among methods.
Logical value, whether NAs have to be removed from the input vector or not.
Character value indicating the taxonomic rank of counted taxa.
Logical value indicating whether NA values in a taxon trait should be considered for counting taxa or just ignored (only used in formula method).
NA
Character value used as suffix for the counted rank in the output data frame (only used in formula method).
Miguel Alvarez kamapu78@gmail.com
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().
length()
## factor method count_taxa(iris$Species) ## taxlist method count_taxa(Easplist) count_taxa(Easplist, level = "species") ## using a formula count_taxa(~life_form, Easplist)
Run the code above in your browser using DataLab