This function allows the user to programatically merge levels of a factor
together to create aggregate levels. This is designed to work for data that
has been discretized by, e.g.
but will work for arbitrary factors. In the case of factors with numeric
levels, the user can specify to merge the names of the old levels when
naming the new level
Vector for which
Character vector containing 2 or more levels of
Logical. Should names of numeric factors be merged?
When not merging names, if levels
C are to be
merged, the resulting level will be
AxBxC. If the factor levels
contain numbers, specifying
merge_names = TRUE will cause
merge_levels to call
on the new level, and then use only the minimum and maximum cutpoints- this
will result in the merge of
[1,4] instead of
[1,2]x[2,3]x[3,4]. While this
seems like obviously what one would want the default behaviour to be, the
user must specify this explicitly to avoid unexpected results.
A new factor level corresponding to
var, with values that were
lv replaced with a new factor level. The name of thre level depends
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.