Calculate a ranked percentile of a numeric vector
mqo_percentile.RdThis function provides a convenient method to calculate a percentile value
from a numeric vector. The vector, x, is ranked in ascending order and the
nth percentile value is inferred by linear interpolation.
Arguments
- x
A numeric vector from which to calculate a percentile value.
- quantile
A quantile value between
0and1. The default,0.9, calculates the 90th percentile.- na.rm
logical; if true, any
NAandNaN's are removed fromxbefore the quantiles are computed.
See also
Other data utilities:
filter_year(),
mutate_rolling_mean(),
summarise_daily(),
validate_mod_obs_pairs()
Examples
mqis <- seq(0.1, 1, by = 0.1)
mqo_percentile(mqis)
#> [1] 0.9
mqo_percentile(mqis[1:9])
#> [1] 0.81