perc_rank | R Documentation |
Calculate the percentile rank corresponding to a breakpoint.
perc_rank(x, breaks, fun = "<=", perc = TRUE, digits = 1,
out.names = as.character(breaks))
x |
Numerical vector of observed data. |
breaks |
Cut-off values to use as breakpoints. |
fun |
Comparison function used to count the data. |
perc |
Logical. Convert the result in percentages. |
digits |
Number of decimals for output. |
out.names |
Names for the elements in the output vector (use |
For each breakpoint, if fun = "<="
, the function returns the percentage of data less than or equal
to the break value. Otherwise, if fun = ">="
, the function returns the percentage of data greater
than or equal to the break value.
data("drive")
score <- rowSums(drive[,5:10])
perc_rank(score, seq(5,25,by=5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.