Learn R Programming

abdiv (version 0.2.0)

richness: Richness or number of observed species

Description

Richness or number of observed species

Usage

richness(x)

Arguments

x

A numeric vector of species counts or proportions.

Value

The number of species observed, \(R \geq 0\).

Details

The richness is simply the number of nonzero elements in x. Relation to other definitions:

  • Equivalent to observed_otus() in skbio.diversity.alpha.

  • Equivalent to specnumber in vegan.

  • Equivalent to the sobs calculator in Mothur.

Examples

Run this code
# NOT RUN {
x <- c(15, 6, 4, 0, 3, 0)
richness(x) # 4
# }

Run the code above in your browser using DataLab