# NOT RUN {
# Random Dataset
set.seed(739)
n <- 750 # numer of points
nr_other_vars <- 2
mat <- matrix(rnorm(nr_other_vars*n),n,nr_other_vars)
me<-4 # mean
x <- c(rnorm(n/3,me/2,1),rnorm(2*n/3,-me/2,1))
y <- c(rnorm(n/3,0,1),rnorm(n/3,me,1),rnorm(n/3,-me,1))
dat <- cbind(mat,x,y)
dat<- as.data.frame(scale(dat)) # scaling
# Create NAs
dat_with_miss <- miss_sim(dat,p=.1,seed_nr=120)
res <- ClustImpute(dat_with_miss,nr_cluster=3)
var_reduction(res)
# }
Run the code above in your browser using DataLab