Given a factor in a CausataData object, this replaces missing values.

Share:

Description

Missing values are replaced with the string "BLANK", or any other string supplied as an input.

Usage

1
2
## S3 method for class 'CausataData'
CleanNaFromFactor(x, variableName=NULL, replacement="BLANK", ...) 

Arguments

x

An object from CausataData.

variableName

If a name is supplied then the variable matching the name will have CleanNaFromFactor applied. If no name is provided then CleanNaFromFactor is applied to every factor in causataData.

replacement

Levels with missing values will be replaced with this string.

...

Unused arguments for other methods.

Value

Returns a CausataData object with the missing value replacements recorded.

Author(s)

Justin Hemann <support@causata.com>

See Also

CleanNaFromFactor, CausataData.

Examples

1
2
3
df <- data.frame(f1__AP=factor(c("a","b",NA)), f2__AP=factor(c("x","y",NA)))
causataData <- CausataData(df, rep(0,nrow(df)))
causataData <- CleanNaFromFactor(causataData)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.