Learn R Programming

ANTsR (version 0.3.1)

antsrimpute: antsrimpute

Description

Impute NA's on data frame.

Usage

antsrimpute(mydat, FUN = mean, ...)

Arguments

mydat

Data frame to be imputed.

FUN

Method to be used for imputation (defaults to mean).

...

Additional parameters to pass to FUN.

Value

Returns mydat with NA's replaced by imputed numbers.

Details

Imputes NA's on data frame (column-wise), using a user-specified function (mean is default). also works on a vector.

Examples

Run this code
# NOT RUN {
mydat <- data.frame(A=c(1,2,4,5), B=c(1,NA,4,5))
mean.impute <- antsrimpute(mydat)
median.impute <- antsrimpute(mydat, median)
# }

Run the code above in your browser using DataLab