Learn R Programming

rarestR (version 1.1.1)

es: Calculate the Expected Species

Description

Calculate the Expected Species

Usage

es(x, m, method = c("a", "b"), MARGIN = 1)

Value

a value of Expected Species

Arguments

x

a data vector representing number of individuals for each species

m

the sample size parameter that represents the number of individuals randomly drawn from the sample. For ESa, m can not be larger than the sample size

method

the calculation approach of Expected Species used, with two options available as "a" and "b" to calculate ESa and ESb, with the default set as "a"

MARGIN

a vector giving the subscripts which the function will be applied over, see 'apply'.

References

zou2025rarestR

Examples

Run this code
data(share, package = 'rarestR')
rowSums(share) #The sum size of each sample is 100, 150 and 200
es(share, m = 100)
es(share, method = "b", m = 100)
# When the m is larger than the total sample size, "NA" will be filled:
es(share, m = 150)

Run the code above in your browser using DataLab