Skip to contents

Provide a ggplot visualisation when ggplot2 is available, otherwise fallback to a lightweight base R bar chart. Supports the custom sobol_result class used in this package, compact sobol_summary data frames, and sensitivity::sobol objects.

Usage

autoplot(object, ...)

# S3 method for class 'sobol_result'
autoplot(
  object,
  show_uncertainty = FALSE,
  probs = c(0.1, 0.9),
  bootstrap = 200L,
  ...
)

# S3 method for class 'sobol'
autoplot(object, separate_panels = TRUE, ncol = 2, ...)

# S3 method for class 'sobol2007'
autoplot(object, ...)

# S3 method for class 'soboljansen'
autoplot(object, ...)

# S3 method for class 'sobolEff'
autoplot(object, ...)

# S3 method for class 'sobolmartinez'
autoplot(object, ...)

# S3 method for class 'sobol_summary'
autoplot(object, ...)

Arguments

object

A sobol_result, sobol_summary, or sensitivity::sobol instance.

...

Further arguments passed to the plotting backend.

show_uncertainty

Logical, when TRUE bootstrap quantiles are computed (if available) and displayed as error bars.

probs

Numeric vector of probabilities used for the uncertainty bars.

bootstrap

Integer indicating how many bootstrap resamples to draw when show_uncertainty = TRUE.

separate_panels

Should the indices be plotted on separate panels according to their order? If separate_panels = TRUE, the first order indices are separated from the higher orders ones.

ncol

If separate_panels = TRUE, the number of columns for the facet wrapping of the plot.

Value

A ggplot object when ggplot2 is installed, otherwise the bar centres invisibly.