taxlist (version 0.1.7)

count_taxa: Count taxa within a taxlist object

Description

Counting number of taxa within '>taxlist objects or character vectors containing taxon names.

Usage

# S4 method for character
count_taxa(object, rm.na=TRUE, ...)

# S4 method for factor count_taxa(object, rm.na=TRUE, ...)

# S4 method for taxlist count_taxa(object, level, ...)

Arguments

object

An object of class '>taxlist.

rm.na

Logical value, whether NAs have to be removed from the input vector or not.

level

Character value indicating the taxonomic rank of counted taxa.

...

further arguments passed among methods.

Value

An integer with the number of taxa.

Details

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.

Examples

Run this code
# NOT RUN {
library(taxlist)

## factor method
count_taxa(iris$Species)

## taxlist method
count_taxa(Easplist)
count_taxa(Easplist, level="species")
# }

Run the code above in your browser using DataLab