Description Usage Arguments Value Author(s) See Also Examples
MergeLevels
is applied to a CausataData object, and the merge process is recorded so that it
can be repeated during scoring.
1 2 3 | ## S3 method for class 'CausataData'
MergeLevels(this, variableName=NULL, max.levels,
other.name="Other", verbose=FALSE, ...)
|
this |
An object from |
variableName |
If a name is supplied then the variable matching the name will have |
max.levels |
See |
other.name |
See |
verbose |
If TRUE then summary information will be printed to the screen. |
... |
Unused extra arguments. |
Returns an object of class CausataData
.
Justin Hemann <support@causata.com>
1 2 3 4 5 6 7 8 | library(stringr)
df <- data.frame(
f1__AP=factor(str_split("a a a b b b c c c d e f g h", " ")[[1]]),
f2__AP=factor(c(rep("x",7),rep("y",7))))
causataData <- CausataData(df, rep(0,nrow(df)))
# For the factor f1__AP, the levels d,e,f,g are merged into Other.
# f2__AP is not altered since it has only two levels.
causataData <- MergeLevels(causataData, max.levels=4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.