Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

impute

Replace Missing Values


Description

Replaces missing values of a matrix or dataframe with the medians (what="median") or means (what="mean") of the respective columns.

Usage

impute(x, what = c("median", "mean"))

Arguments

x

A matrix or dataframe.

what

What to impute.

Value

A matrix or dataframe.

Author(s)

Friedrich Leisch

Examples

x<- matrix(1:10, ncol=2)
x[c(1,3,7)] <- NA
print(x)
print(impute(x))

e1071

Misc Functions of the Department of Statistics, Probability Theory Group (Formerly: E1071), TU Wien

v1.7-11
GPL-2 | GPL-3
Authors
David Meyer [aut, cre], Evgenia Dimitriadou [aut, cph], Kurt Hornik [aut], Andreas Weingessel [aut], Friedrich Leisch [aut], Chih-Chung Chang [ctb, cph] (libsvm C++-code), Chih-Chen Lin [ctb, cph] (libsvm C++-code)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.