set.missing.factors.to.NA: Replace empty factor values with "NA"

Description Usage Arguments Value Examples

Description

Replaces blank factor values with "NA". Recreates factor variable with new level.

Usage

1
set.missing.factors.to.NA(data, variables, logging = FALSE)

Arguments

data

data frame with variables of interest

variables

vector of factors

logging

flag to write detailed stats in standard output (default=FALSE)

Value

data frame with replaced missing values for selected variables

Examples

1
set.missing.factors.to.NA(df, c('var1','var2','var3'), logging=TRUE)

konstantin-kotochigov/ML-UTILS documentation built on May 17, 2019, 7:30 p.m.