Skip to contents

autoplot(set) splits a WorkPrecisionSet() into the sets one would plot to compare its methods, as a named list: family_<tag> with the entries of each family present (by default the tags of kind "family" of the set), plus the entries tagged with any of reference_tags; best_of_families with the best_n best entries of each family (and the references); and all, the whole set. It draws nothing; plot the sets with plot().

Usage

autoplot(object, ...)

# S3 method for class 'WorkPrecisionSet'
autoplot(object, families = NULL, reference_tags = NULL, best_n = 2L, ...)

Arguments

object

A WorkPrecisionSet.

...

Unused.

families

Family tags.

reference_tags

Tags of reference entries added to every set.

best_n

Number of entries per family in best_of_families.

Value

A named list of WorkPrecisionSets.

Details

The same method is registered for the autoplot() generic of ggplot2, so it also answers ggplot2::autoplot(set), and autoplot() passes other objects on to ggplot2 when it is installed.

Examples

prob <- ODEProblem(function(u, p, t) -u, 1, c(0, 1))
tols <- c(1e-3, 1e-4)
mk <- function(name, e, tags) WorkPrecision(prob, tols, tols, list(final = e), c(1, 2) / 1000, NULL,
  NULL, name, "final", 2, tags)
set <- WorkPrecisionSet(list(mk("A", c(1e-2, 1e-4), "rk"), mk("B", c(1e-3, 1e-5), "rosenbrock")), 2,
  tols, tols, prob, NULL, c("A", "B"), "final", NULL)
names(autoplot(set))
#> [1] "family_rk"         "family_rosenbrock" "best_of_families" 
#> [4] "all"