quantile: Quantiles

View source: R/quantile.R

quantileR Documentation

Quantiles

Description

Calculates the quantiles of a numeric vector.

Details

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)

See Also

median(), mean(), min(), max(), sd()

Examples

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.


cobriant/qelp documentation built on July 1, 2022, 7:24 a.m.