Learn R Programming

swfscMisc (version 1.6.5)

diversity: Unbiased Estimate of Diversity

Description

Calculate unbiased estimate of diversity for a vector of items

Usage

diversity(x)

Arguments

x

character or numeric vector or factor

Author

Eric Archer eric.archer@noaa.gov

Examples

Run this code
x <- sample(1:5, 100, replace = TRUE)
diversity(x)

Run the code above in your browser using DataLab