Intended for use in constructing rarity plots, this function takes a numeric vector of integers representing species abundances, and returns the weights for each, unique rarity value. This is to solve overplotting and convey the total "weight" of all species of a given rarity.

combfun(x)

Arguments

x

numeric vector

Value

A vector of weights, where only unique quantities have weights. The length of the new vector could be much shorter than length(x).

Examples

combfun(c(1, 2, 3, 3, 3, 4, 5, 9))
#> [1] 1 2 9 4 5 9