Learn R Programming

DiversitySampler (version 2.1)

count: Counting Species Abundances

Description

Takes a vector of species names and counts the abundance of each unique species.

Usage

count(sv = "species vector", x = "species sample vector")

Arguments

sv
A vector of species numbers or names.
x
A vector of species occurrences.

Value

Returns a vector of species counts.

Details

This function is used within the H.sampler function.

Examples

Run this code
sv=1:10
x=c(1,1,1,1,1,2,3,3,5,5,5,6,7,8,9,10)
cbind(sv,count(sv,x))

Run the code above in your browser using DataLab