Description Usage Arguments Value Examples
Cuts a numeric column using Hmisc::cut2
and optionally assigns different
labels to the levels produced.
If labels are provided, there must be as many of them as there are levels.
1 | column.cut(x, field, cuts, labels = NULL)
|
x |
input data frame |
field |
name of numeric column in x to cut |
cuts |
cut points. If |
labels |
optional character vector of level labels. If used, must be same length as the factor produced. |
factor with binned values for x[[field]]
and the names from labels
1 2 3 4 5 | med.inc <- acs.median(wa.house16, 'HINCP')
cuts <- med.inc * c(0.3, 0.5, 0.8, 1.2)
labels <- c('0-30 AMI', '30-50 AMI', '50-80 AMI', '80-120 AMI', '>120 AMI')
wa.house16$Income.Band <- column.cut(wa.house16, 'HINCP', cuts=cuts, labels=labels)
group.count(wa.house16, 'Income.Band', drop.na.group=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.