This function is a faster implementation of the "type 7" quantile() algorithm and is modified from this gist: It returns sample quantiles corresponding to the given probabilities. The smallest observation corresponds to a probability of 0 and the largest to a probability of 1. For speed, output quantile names are removed as are error handling such as checking if x are factors, or if probs lie outside the [0,1] range.

fquantile(x, probs = seq(0, 1, 0.25), na.rm = FALSE)



numeric vector whose sample quantiles are wanted. NA and NaN values are not allowed in numeric vectors unless na.rm is TRUE.


numeric vector of probabilities with values in [0,1]. (Values up to 2e-14 outside that range are accepted and moved to the nearby endpoint.)


logical; if TRUE, any NA and NaN's are removed from x before the quantiles are computed.


A vector of length length(probs) is returned;