Learn R Programming

missRanger (version 1.0.4)

imputeUnivariate: Univariate Imputation

Description

Fills missing values of a vector of any type by sampling with replacement from the non-missing values. Requires at least one non-missing value to run.

Usage

imputeUnivariate(x)

Arguments

x

A vector of any type possibly containing missing values.

Value

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

Examples

Run this code
# NOT RUN {
imputeUnivariate(c(NA, 0, 1, 0, 1))
imputeUnivariate(c("A", "A", NA))
imputeUnivariate(as.factor(c("A", "A", NA)))
# }

Run the code above in your browser using DataLab