plot.synMicro_object {synMicrodata} | R Documentation |
Plot Comparing Synthetic Data with Original Input Data
Description
The plot
method for synMicro_object
object.
This method compares synthetic datasets with original input data.
Usage
## S3 method for class 'synMicro_object'
plot(x, vars, ...)
Arguments
x |
|
vars |
vector of names or indices of the variables to compare. |
... |
other parameters to be passed through to plotting functions. |
Details
The plot
takes input variables and draws the graph.
The type of graph produced is contingent upon the number of categories in selected variables.
Putting a continuous variable produces a box plot of the selected variable.
Putting more than two continuous variables produces pairwise scatter plots for each pair of selected variables.
Putting categorical variables produce bar plot of each selected variable.
See Also
Examples
## 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")
[Package synMicrodata version 2.0.0 Index]