quantile | R Documentation |
Calculates the quantiles of a numeric vector.
The first argument x
is a numeric vector.
The second argument is a vector of probabilities.
For instance, probs = .5
will return the median of x
.
quantile(x, probs)
median()
, mean()
, min()
, max()
, sd()
1:10 %>% quantile(probs = c(.25, .5, .75)) #> 25% 50% 75% #> 3.25 5.50 7.75 ----------------------------------- library(gapminder) gapminder %>% summarize(pops = quantile(pop, c(.1, .5, .9))) #> pops <dbl> #> 1 946367. #> 2 7023596. #> 3 54801370.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.