Learn R Programming

clhs (version 0.4-3)

plot.cLHS_result: Plot cLHS results

Description

Produces a plot illustrating the result of a cLHS sampling procedure.

Usage

## S3 method for class 'cLHS_result':
plot(x, modes = "obj", ...)

Arguments

x
Object of class cLHS_result.
modes
A character vector describing the plot to produce (see Details)
...
Other ggplot2 plotting parameters.

Details

The subplots to be included in the final illustration are controlled by the mdoe option: - "obj" adds the evolution of the objective function over the iterations - "hist" adds the comparison of the distributions of each variables in both the original object and the sampled result using histogram plots (for continuous variables). - "dens" adds the comparison of the distributions of each variables in both the original object and the sampled result using density plots (for continuous variables).

See Also

clhs

Examples

Run this code
df <- data.frame(a = runif(1000), b = rnorm(1000), c = sample(LETTERS[1:5], size = 1000, replace = TRUE))
res <- clhs(df, size = 50, iter = 2000, progress = FALSE, simple = FALSE)
# You can plot only the objective function
plot(res, mode = "obj")
# Or you can compare the distribution in the original object 
# and in the sampled result
plot(res, mode = c("obj", "hist"))

Run the code above in your browser using DataLab