impute | R Documentation |
Replaces missing values of a matrix or dataframe with the
medians (what="median"
) or means (what="mean"
) of the
respective columns.
impute(x, what = c("median", "mean"))
x |
A matrix or dataframe. |
what |
What to impute. |
A matrix or dataframe.
Friedrich Leisch
x<- matrix(1:10, ncol=2)
x[c(1,3,7)] <- NA
print(x)
print(impute(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.