impute_ecdf: Helper function that samples from the empirical cumulative...

Description Usage Arguments Value See Also Examples

Description

impute returns a vector of values imputed from sampling from the ecdf of x.

Usage

1
impute_ecdf(x, n = 1)

Arguments

x

A vector.

n

The number of values to impute.

Value

The output of impute_ecdf is a vector of imputed values of length n

See Also

Other imputers: impute_mode, impute_sample, impute

Examples

1
2
3
4
5
6
7
x <- c(1, 2, 3, 4, 5, NA, NA)

# Impute via ecdf sampling
x_impute <- impute(x, impute_ecdf)

# Compare
data.frame(x, x_impute)

derek-damron/transform documentation built on May 15, 2019, 3:57 a.m.