Learn R Programming

testarguments (version 0.0.1)

plot_diagnostics: Visualise diagnostics across the tested arguments

Description

Using various aesthetics, plot_diagnostics() can visualise the performance of all combinations of up to 4 different arguments simultaneously.

Usage

plot_diagnostics(
  object,
  focused_args = NULL,
  average_out_non_focused_args = TRUE,
  plot_order = NULL
)

Arguments

object

an object of class 'testargs'

focused_args

the arguments we wish to plot. If NULL, all arguments are plotted (i.e., focused_args = object@arg_names)

average_out_non_focused_args

logical indicating whether we should average over the non-focused arguments

plot_order

specifies the order in which we are to assign arguments to the various aesthetics. If NULL, the arguments are assigned based on their type, in the order 'numeric', 'integer', 'factor', 'character', and 'logical'. Otherwise, plot_order should be an integer vector with the same length as focused_args

Value

a facetted 'ggplot' object, where:

  • the columns of the facet are split by the diagnostics

  • the y-axis corresponds to the values of the diagnostics

  • the x-axis corresponds to the first argument

  • the colour scale and grouping correspond to the second argument (if present)

  • if a third argument is present, facet_grid() is used, whereby columns correspond to levels of the third argument, and rows correspond to diagnostics. Note that facet_grid() forces a given row to share a common y-scale, so the plot would be misleading if diagnostics were kept as columns

  • the shape of the points corresponds to the fourth argument (if present)

Examples

Run this code
# NOT RUN {
## See ?test_arguments
# }

Run the code above in your browser using DataLab