antsrimpute | R Documentation |
Impute NA's on data frame.
antsrimpute(mydat, FUN = mean, ...)
mydat |
Data frame to be imputed. |
FUN |
Method to be used for imputation (defaults to mean). |
... |
Additional parameters to pass to FUN. |
Imputes NA's on data frame (column-wise), using a user-specified function (mean is default). also works on a vector.
Returns mydat with NA's replaced by imputed numbers.
Kandel BM, Avants BB
mydat <- data.frame(A = c(1, 2, 4, 5), B = c(1, NA, 4, 5))
mean.impute <- antsrimpute(mydat)
mean.impute <- antsrimpute(mydat$B)
median.impute <- antsrimpute(mydat, median)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.