[R] Missing completely at random

Steven Kennedy stevenkennedy2263 at gmail.com
Wed Jun 1 23:34:22 CEST 2011


This works, but there might be a better way:

misscols<-lapply(howmanyMiss, function(x) sample(1:n, x))

for (i in 1:nMiss){
	for (j in misscols[[i]]){
		X[idMiss[i],j]<-NA
	}
}



More information about the R-help mailing list