simple.impute | R Documentation |
Generic function for simple imputation.
simple.impute(x, fun = median, ...)
x |
An object to be imputed |
fun |
The function with which to fill in missing values |
... |
Further arguments |
Provides the ability to simply impute data based on a simple measure such as mean or median. For more robust imputation see the packages Amelia, mice or mi.
An object with the missing values imputed.
Jared P. Lander
theDF <- data.frame(A=1:10, B=1:10, C=1:10)
theDF[c(1, 4, 6), c(1)] <- NA
theDF[c(3, 4, 8), c(3)] <- NA
simple.impute(theDF$A)
simple.impute(theDF$A, mean)
simple.impute(theDF$A, constant(4))
simple.impute(theDF)
simple.impute(theDF, mean)
simple.impute(theDF, constant(4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.