thresh: A function to return the maximum percentage of the cumulative sum represented
by a subset of the vector
Description
Returns the proportion of the cumulative sum represented by the
number of elements in the vector a user specifies. This allows the user to
identify the maximum proportion of the total that only X number of elements
may represent in the vector.
Usage
thresh(x, cutoff, na.rm = TRUE)
Value
A numeric proportion
Arguments
x
a numeric vector, missing values are allowed
cutoff
numeric, the number of elements to look at
na.rm
logical, should missing values be excluded?
Author
Jared E. Knowles
Details
Calculates the proportion of a numeric vector reached after sorting
the vector in ascending order and stopping at the specified count