plotOptions | R Documentation |
plotOptions
uses the system model performances calculated using the function runSystemModel
for two alternate system model options,
and the summary of the simulation generated using the functions generateScenarios
& getSimSummary
as input. The function plots the differences in
the performance metrics between the two options, and the changes in performance thresholds in the space.
The user may specify the attributes to be used as the axes of the plot. The function contains arguments to control the finer details of the plot.
plotOptions(
performanceOpt1,
performanceOpt2,
sim,
metric = NULL,
attX = NULL,
attY = NULL,
topReps = NULL,
opt1Label = "Option 1",
opt2Label = "Option 2",
titleText = paste0(opt2Label, " - ", opt1Label),
perfThresh = NULL,
perfThreshLabel = "Threshold",
attSlices = NULL,
climData = NULL,
colMap = NULL,
colLim = NULL
)
performanceOpt1 |
a named list; contains the system model performance calculated using |
performanceOpt2 |
a named list; contains the system model performance calculated using |
sim |
a list; summary of the simulation containing the scenarios generated using the function |
metric |
a string; the name of the performance metric to be plotted. The argument can be used to select the metric from
|
attX |
a string; the tag of the perturbed attribute to plot on the xaxis. The attribute must be one of the perturbed attributes of |
attY |
a string; the tag of the perturbed attribute to plot on the yaxis. The attribute must be another perturbed attribute of |
topReps |
an integer (default is |
opt1Label |
a string; the text to label |
opt2Label |
a string; the text to label |
titleText |
a string; text for the title of the plot. The default is |
perfThresh |
a number; the minimum or maximum threshold value of the performance metric. A line will be drawn to mark this threshold value in the performance space. |
perfThreshLabel |
a string; the text to label |
attSlices |
a list; used to subset perturbed attributes in |
climData |
data.frame; the values of attX and attY from other sources like climate models. This data will be plotted as points in the performance space.
The data frame may contain columns with values of the performance metric to be plotted and the "Name" of the dataset.
If the performance metric is available in the data.frame, the points will be coloured based on the performance |
colMap |
a vector of colours; to specify the colourmap to be used. If |
colLim |
a vector of 2 values; the minimum and maximum limits of the colour scale. |
The plot of the differences in the performance metrics (option 2 - option 1) in a ggplot object.
runSystemModel
, plotPerformanceSpace
, generateScenarios
, getSimSummary
# load example datasets
data("egSimSummary")
data("egSimPerformance") # performance of option1
data("egSimPerformance_systemB") # performance of option2
data("egClimData")
plotOptions(egSimPerformance[1], egSimPerformance_systemB [1], egSimSummary,
attX = "P_ann_seasRatio", attY = "P_ann_tot_m", topReps = 7, perfThreshLabel = "Threshold (28L)",
perfThresh = 28, opt1Label = "System A", opt2Label = "System B", climData = egClimData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.