imputeMissings: Impute missing values with the median or mode.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/imputeMissings.R

Description

Character vectors and factors are imputed with the mode. Numeric and integer vectors are imputed with the median.

Usage

1

Arguments

data

A data frame.

Value

A data frame.

Author(s)

Dirk Van den Poel, Michel Ballings, Andrey Volkov, Jeroen D”haen, Michiel Van Herwegen

Maintainer: Michel Ballings <[email protected]>

References

Van den Poel, D., Ballings, M., Volkov, A., D”haen, J., Van Herwegen, M., Predictive Analytics for analytical Customer Relationship Management using SAS, Oracle and R, Springer, Forthcoming.

See Also

Other functions in this package: imputeMissings, Aggregate, cocktailEnsemble, predict.cocktailEnsemble

Examples

1
2
3
4
5
6
#create some data
data <- data.frame(V1=as.factor(c('yes','no','no',NA,'yes','yes','yes')),
                   V2=as.character(c(1,2,3,4,4,4,NA)),
                   V3=c(1:6,NA),V4=as.numeric(c(1:6,NA)))
#demonstrate function
imputeMissings(data)

aCRM documentation built on May 29, 2017, 11:26 a.m.