[R] Partition into quantiles

Alberto Monteiro albmont at centroin.com.br
Thu Oct 5 14:39:15 CEST 2006


Is there any function that divides a sample into N quantiles?

For example, for N = 2, this would be the solution:

x <- rnorm(100)
m <- median(x)
q <- ifelse(x <= median, 1, 2)

Alberto Monteiro



More information about the R-help mailing list