View source: R/calc_quantiles.R
calc_quantiles | R Documentation |
This is a wrapper function for quantile for easy use with data frames.
calc_quantiles(
.data,
value = NA,
probs = c(q0 = 0, q25 = 0.25, q50 = 0.5, q75 = 0.75, q100 = 1),
na.rm = TRUE,
type = 7
)
calc_quantiles_(
.data,
value = "value",
probs = c(q0 = 0, q25 = 0.25, q50 = 0.5, q75 = 0.75, q100 = 1),
na.rm = TRUE,
type = 7
)
.data |
a data frame, possibly grouped |
value |
column name for which sample quantiles should be calculated |
probs |
named numeric vector of probabilities with values in
|
na.rm |
logical; if |
type |
an integer between 1 and 9 select one of the nine quantile algorithms detailed in quantile to be used. |
A data frame.
Michaja Pehl
require(dplyr)
require(tidyr)
tibble(group = rep(c("A", "B"), 10),
value = 1:20) %>%
group_by(group) %>%
calc_quantiles() %>%
pivot_wider(names_from = 'quantile')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.