x <- c(1,2,NA,4,5,NA)
randomImput(x)
if (interactive()) {
n = 100
mat <- matrix(ncol=3, nrow=n)
for(i in 1:n){
mu = mean(randomImput(x))
med = median(randomImput(x))
mod = Mode(randomImput(x))
mat[i,] <- c(mu, med, mod[1])
}
print(mat)
}
Run the code above in your browser using DataLab