R/meanimp.R

meanimp <-
function(mat)
{
m<-ncol(mat)
for (i in 1:m)
{
mat[which(is.na(mat)[,i]),i]<-mean(mat[which(is.na(mat[,i])==FALSE),i])
}
mat
}

Try the ForImp package in your browser

Any scripts or data that you put into this service are public.

ForImp documentation built on May 2, 2019, 8:17 a.m.