percent_cutoff | R Documentation |
Takes a numeric vector and a numeric vector of thresholds. Returns the percent of numbers in the first above each of the numbers in the second.
percent_cutoff(x, cutoffs = c(0.3, 0.5), digits = 2, below = F, inclusive = T)
x |
(num vector) A vector of numbers. |
cutoffs |
(num vector) A vector of thresholds. Default=(.30, .50) |
digits |
(num scalar) The number of digits to round output to. Default=2. |
below |
(log scalar) Whether to count values below the cutoff (default false). |
inclusive |
(log scalar) Whether to include values at the cutoff (default true). |
percent_cutoff(iris$Sepal.Length, cutoffs = 4:8)
percent_cutoff(iris$Sepal.Length, cutoffs = 4:8, below = T) #reverse cutoff
percent_cutoff(c(1:3, NA, NaN, 4:6), cutoffs = 3) #ignores NA/NaN
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.