plot.cLHS_result {clhs} | R Documentation |
Produces a plot illustrating the result of a cLHS sampling procedure.
## S3 method for class 'cLHS_result'
plot(x, modes = "obj", ...)
x |
Object of class “cLHS_result”. |
modes |
A character vector describing the plot to produce (see Details) |
... |
Other ggplot2 plotting parameters. |
The subplots to be included in the final illustration are controlled by the
mode
option: - "obj"
adds the evolution of the objective
function over the iterations - "cost"
adds the evolution of the cost
function over the iterations (if available in x
) - "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). - "box"
adds the comparison of the
distributions of each variables in both the original object and the sampled
result using boxplots (for continuous variables).
Pierre Roudier
df <- data.frame(
a = runif(1000),
b = rnorm(1000),
c = sample(LETTERS[1:5], size = 1000, replace = TRUE)
)
res <- clhs(df, size = 50, iter = 1000, use.cpp = FALSE, 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", "box"))