Learn R Programming

Causata (version 4.2-0)

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

Description

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

Usage

"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.

See Also

CleanNaFromFactor, CausataData.

Examples

Run this code
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)

Run the code above in your browser using DataLab