powered by
This function transforms a quantitative variable into a qualitative one by breaking it into classes with the same frequencies.
quant.cut(var, nbclass, include.lowest = TRUE, right = FALSE, dig.lab = 5, ...)
The result is a factor.
variable to transform
number of classes
argument passed to the cut function
cut
arguments passed to the cut function
This is just a simple wrapper around the cut and quantile functions.
quantile
cut, quantile
data(iris) sepal.width3cl <- quant.cut(iris$Sepal.Width,3) table(sepal.width3cl)
Run the code above in your browser using DataLab