cut_quantiles | R Documentation |
A numeric vector is cut in n-intervals corresponding to quantiles (e.g: for n = 3, the vector is cut by tertiles). A data frame is returned which contains the initial value, the interval assignment and, optionally, the user-provided labeling.
cut_quantiles(x, n, labels = NULL, right = FALSE)
x |
a numeric vector. |
n |
a single numeric defining the number of quantile intervals. |
labels |
an optional user-provided vector of labels. |
right |
logical, indicating if the intervals should be closed on the right (and open on the left) or vice versa. |
the minimum and maximum values are always included in the first and the last interval, respectively. NAs are silently removed.
A tibble with the initial values in the order as they were provided, the interval assignment and the user-provided labeling.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.