na.to.missing: NA to Missing

Description Usage Arguments Examples

Description

Recode all NA values into missing in a data.frame of factors

Usage

1
na.to.missing(x, convert.to.factor = FALSE, missing.value = "MISSING")

Arguments

x

is a data.frame of factors

convert.to.factor

if TRUE all non-factor columns in x are converted to factors

missing.value

is the new value given to the NA values

Examples

1
2
3
x <- as.data.frame(matrix(rep(c("a", "b", "c", NA), 3), ncol=3))
x
na.to.missing(x)

antongrau/soc.report documentation built on May 10, 2019, 12:25 p.m.