| binVariable | R Documentation |
Bin a Numeric Variable
binVariable(
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 |
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.
A factor.
Dan Putler, slightly modified by John Fox (5 Dec 04 & 5 Mar 13) with the original author's permission.
cut, kmeans.
summary(binVariable(rnorm(100), method="prop", labels=letters[1:4]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.