bin.var {Rcmdr} | R Documentation |
Create a factor dissecting the range of a numeric variable into
bins of equal width, (roughly) equal frequency, or at "natural"
cut points. The cut
function is used to create the factor.
bin.var(x, bins = 4, method = c("intervals", "proportions", "natural"), labels = FALSE)
x |
numeric variable to be binned. |
bins |
number of bins. |
method |
one of |
labels |
if |
A factor.
Dan Putler, slightly modified by John Fox jfox@mcmaster.ca with the original author's permission.
summary(bin.var(rnorm(100), method="prop", labels=letters[1:4]))