handleNAsMean | R Documentation |
Remove NAs from a vector by replacing them by the sample mean.
handleNAsMean( x, y = NULL, imputeCriteriaFuns = list(is.na, is.infinite, is.nan), penaltyImputation = 3 )
x |
The x values from which y was calculated, not used here |
y |
The vector of numerics from which the NAs should be removed |
imputeCriteriaFuns |
|
penaltyImputation |
penalty used for imputed values |
y The cleaned vector
vecWithNAs <- c(-1, 0,1,NA,3,Inf,5,NA) control <- spotControl(dim=length(vecWithNAs)) print(vecWithNAs) print(handleNAsMean(y=vecWithNAs, imputeCriteriaFuns= control$yImputation$imputeCriteriaFuns))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.