Skip to content
Prev 318354 / 398503 Next

cut a vector in equal parts

Hello,

Try the following.

x <- rnorm(500)^2
split(x, cut(x, quantile(x, probs = seq(0, 1, by = 0.2))))


Hope this helps,

Rui Barradas

Em 26-02-2013 17:39, Martin Batholdy escreveu: