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

Description Usage Arguments Value Examples

View source: R/functions.R

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/R_ml_utils documentation built on May 3, 2019, 4:07 p.m.