quantile {stats} R Documentation

Sample Quantiles

Description


The generic function quantile produces sample quantiles corresponding
to the given probabilities. The smallest observation corresponds to
a probability of 0 and the largest to a probability of 1.

Usage

quantile(x,
    probs = [0.25,0.5,0.75,1]);

Arguments

x

numeric vector whose sample quantiles are wanted, or an object of a class for which a method has been defined (see also ‘details’). NA and NaN values are not allowed in numeric vectors unless na.rm is TRUE. [as double]

probs

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.)

env

[as Environment]

Details

Authors

sciBASIC.NET

Value

A vector of length length(probs) is returned; if names = TRUE, it has a names attribute. NA And NaN values in probs are propagated to the result. The Default method works With classed objects sufficiently Like numeric vectors that sort And (Not needed by types 1 And 3) addition Of elements And multiplication by a number work correctly. Note that As this Is In a Namespace, the copy Of sort In base will be used, Not some S4 generic Of that name. Also note that that Is no check On the 'correctly’, and so e.g. quantile can be applied to complex vectors which (apart from ties) will be ordered on their real parts. There Is a method for the date-time classes (see "POSIXt"). Types 1 And 3 can be used for class "Date" And for ordered factors.

clr value class

Examples


[Package stats version 5.0.1.2389 Index]