
Last chance! 50% off unlimited learning
Sale ends in
Remove NAs from a vector by replacing them by the currant max + p*s.d., where p denotes a penalty term.
handleNAsMax(
x,
y = NULL,
imputeCriteriaFuns = list(is.na, is.infinite, is.nan),
penaltyImputation = 3
)
The x values from which y was calculated, not used here
The vector of numerics from which the NAs should be removed
list
criteria functions specified via
imputeCriteriaFuns
in spotControl
. Default:
list(is.na, is.infinite, is.nan)
.
penalty used for imputed values
y The cleaned vector
# NOT RUN {
vecWithNAs <- c(-1, 0,1,NA,3,Inf,5,NA)
control <- spotControl(dim=length(vecWithNAs))
print(vecWithNAs)
print(handleNAsMax(y=vecWithNAs,
imputeCriteriaFuns= control$yImputation$imputeCriteriaFuns))
# }
Run the code above in your browser using DataLab