Visualize the simulation(s) used during verify(). Each condition j is
displayed as a subplot. Simulations are always available since verify()
unconditionally retains them.
# S3 method for verify_stockflow
plot(
x,
test = NULL,
vars = NULL,
show_constants = FALSE,
label = NULL,
ignore_case = TRUE,
status = c("pass", "fail", "error", "skip"),
condition = seq(1, min(c(x[["n_conditions"]], 9))),
nrows = ceiling(sqrt(max(condition))),
shareX = TRUE,
shareY = TRUE,
palette = "Dark 2",
colors = NULL,
font_family = "Times New Roman",
font_size = 16,
wrap_width = 25,
showlegend = TRUE,
label_subplots = TRUE,
alpha = 1,
margin = 0.05,
...
)A plotly object.
Output of verify().
Integer vector of test numbers to plot.
Combines with label and status as AND intersection.
Variables to plot. Defaults to NULL to plot all variables.
If TRUE, include constants in plot. Defaults to FALSE.
Character vector of regex patterns for partial, case-insensitive label matching. A test is included if its label matches any pattern.
Logical; whether label matching is case-insensitive.
Default TRUE.
Optional character vector of statuses to include (e.g.,
c("fail", "error")). Defaults to all statuses.
which = "tests": filters rows by test status.
which = "sims": filters to conditions that have at least one test
with a matching status.
Integer vector of condition numbers to plot. Defaults to 1:9. If only one condition is specified, the plot will not be a grid of subplots.
Number of subplot rows. Defaults to ceiling(sqrt(condition)).
Share the x-axis across subplots. Defaults to TRUE.
Share the y-axis across subplots. Defaults to TRUE.
Colour palette (see hcl.pals()). Defaults to "Dark 2".
Vector of colours overriding palette. Defaults to NULL.
Font family. Defaults to "Times New Roman".
Font size. Defaults to 16.
Label wrap width. Defaults to 25.
Whether to show the legend. Defaults to TRUE.
Whether to plot labels indicating the test number of the subplot.
Trajectory opacity. Defaults to 1.
Margin between subplots. Either a single numeric or a vector of length four(left, right, top, bottom). See ?plotly::subplot() for more details. Defaults to 0.05.
Additional arguments passed to plot.simulate_stockflow().
verify(), plot.simulate_stockflow(), plot.ensemble_stockflow()
sfm <- stockflow("SIR") |>
unit_test(expr = all(susceptible >= 0))
res <- verify(sfm)
plot(res)
Run the code above in your browser using DataLab