## preparing to generate synthetic datsets
dat_obj <- readData(Y_input = iris[,1:4],
X_input = data.frame(Species = iris[,5]))
mod_obj <- createModel(dat_obj, max_R_S_K=c(30,50,20))
## generating synthetic datasets
res_obj <- multipleSyn(dat_obj, mod_obj, n_burnin = 100, m = 2,
interval_btw_Syn = 50, show_iter = FALSE)
print(res_obj)
## plotting synthesis datasets
### box plot
par(mfrow=c(3,2))
plot(res_obj, vars = "Sepal.Length") ## variable names
### pairwise scatter plot
plot(res_obj, vars = c(1,2)) ## or variable index
### bar plot
plot(res_obj, vars = "Species")
### specify the synthetic dattaset
par(mfrow=c(1,1))
plot(res_obj, vars = "Petal.Length", plot_num=1)
Run the code above in your browser using DataLab