plot.cLHS_result: Plot cLHS results

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.R

Description

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

Usage

1
2
## 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 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).

Author(s)

Pierre Roudier

See Also

clhs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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"))

	

clhs documentation built on Oct. 14, 2021, 9:06 a.m.