plot.riskyr is a method that allows to generate different plot types from a "riskyr" object.

# S3 method for riskyr
plot(x = NULL, type = "prism", main = NULL, sub = NULL, ...)

Arguments

x

A riskyr object, usually a result of a call to riskyr. Pre-defined scenarios are also of type riskyr.

type

The type of plot to be generated.

main

Text label for main plot title. Default: main = NULL (using x$scen_lbl per default).

sub

Text label for plot subtitle (on 2nd line). Default: sub = NULL (using sub = "type" shows plot type).

The following plot types are currently available:

  1. type = "prism" or type = "net" or type = "tree": Risk information is plotted in a network diagram of frequencies and probabilities (default). See plot_prism for further options.

  2. type = "tab" or type = "ftab": Risk information is plotted as a 2-by-2 frequency or contingency table. See plot_tab for further options.

  3. type = "area" or type = "mosaic": Risk information is plotted as a mosaic plot (scaled area). See plot_area for further options.

  4. type = "bar" or type = "fbar": Risk information is plotted as a bar chart. See plot_bar for further options.

  5. type = "icons" or type = "iconarray": The underlying population is plotted as an array of icons. See plot_icons for further options.

  6. type = "curve" or type = "curves": Draws curves of selected values (including PPV, NPV) See plot_curve for further options.

  7. type = "plane" or type = "planes": Draws a 3D-plane of selected values (e.g., predictive values PPV or NPV) See plot_plane for further options.

...

Additional parameters to be passed to the underlying plotting functions.

Details

plot.riskyr also uses the text settings specified in the "riskyr" object.

See also

riskyr initializes a riskyr scenario.

Other visualization functions: plot_area(), plot_bar(), plot_crisk(), plot_curve(), plot_fnet(), plot_icons(), plot_mosaic(), plot_plane(), plot_prism(), plot_tab(), plot_tree()

Other riskyr scenario functions: riskyr(), summary.riskyr()

Examples

# Select a scenario (from list of scenarios):
s1 <- scenarios$n1  # select scenario 1 from scenarios
plot(s1)  # default plot (type = "prism")

# Plot types currently available:
plot(s1, type = "prism")                # prism/network diagram (default)

plot(s1, type = "tree", by = "cd")      # tree diagram (only 1 perspective)

plot(s1, type = "area")                 # area/mosaic plot

plot(s1, type = "tab")                  # 2x2 frequency/contingency table

plot(s1, type = "bar", dir = 2)         # bar plot

plot(s1, type = "icons")                # icon array

plot(s1, type = "curve", what = "all")  # curves as fn. of prev

plot(s1, type = "plane", what = "NPV")  # plane as function of sens & spec

plot(s1, type = "default")              # unknown type: use default plot
#> Unknown plot type (in plot.riskyr): Using type = 'prism'.