Extract a plot corresponding to one or several variables from a ggplot.

extract_plot(
  plot,
  var = NULL,
  situation = NULL,
  force = TRUE,
  verbose = TRUE,
  situations = lifecycle::deprecated()
)

Arguments

plot

The output of plot_situations.

var

Vector of variable names for which plots have to be extracted. Optional, all variables considered by default.

situation

A list of situations names to extract from a list of ggplots

force

Continue if the plot is not possible ? E.g. no observations for scatter plots. If TRUE, return NULL, else return an error.

verbose

Logical value for displaying information while running.

situations

[Deprecated] situations is no longer supported, use situation instead.

Value

A (printed) list of ggplot objects, each element being a plot for a situation