impute_factor: Majority Imputation

Description Usage Arguments Value Examples

Description

Fills missing values of a factor vector by using the majority rule. If there are several levels with the same number of votes, samples one at random and fills the missing values

Usage

1

Arguments

x

A factor vector possibly containing missing values.

Value

A factor vector of the same length as x but without missing values.

Examples

1
2
3
x <- as.factor(c(1,1,2,2,3,3,3))
x[3] <- NA
impute_factor(x)

kvantas/missTune documentation built on May 12, 2019, 10:51 a.m.