Learn R Programming

sprex (version 1.4.1)

sample.to.species.freq: Create Vector of Species Frequencies

Description

Create vector of species frequencies from vector of sample frequencies.

Usage

sample.to.species.freq(x, min.f = NULL)

Arguments

x
a vector where x[i] is of the number of samples in the i-th species.
min.f
minimum size of return vector. Return vector is zero-padded up to this length if it would normally be shorter.

Value

a vector(f) of species frequencies where f[i] is the number of species represented by only i samples.

See Also

species.to.sample.freq

Examples

Run this code
x <- sample(1:20, 20, rep = TRUE)
f <- sample.to.species.freq(x)
print(x)
print(f)

Run the code above in your browser using DataLab