View source: R/plotPerformanceSpaceMulti.R
plotPerformanceSpaceMulti | R Documentation |
plotPerformanceSpaceMulti
uses multiple system model performances calculated using the function runSystemModel
and
the summary of the simulation generated using the functions generateScenarios
& getSimSummary
as input to plot filled contours showing the
number of performance thresholds exceeded in the perturbation space.
The user may specify the attributes to be used as the axes of the perturbation space.
plotPerformanceSpaceMulti(
performance,
sim,
perfThreshMin,
perfThreshMax,
attX = NULL,
attY = NULL,
attSlices = NULL,
topReps = NULL,
climData = NULL,
col = NULL,
axesPercentLabel = FALSE
)
performance |
a list; each element of the list should be a performance metric. May be calculated using the function |
sim |
a list; summary of the simulation containing the scenarios generated using the function |
perfThreshMin |
a vector; the minimum threshold value of each performance metric. The length of the vector should be equal to |
perfThreshMax |
a vector; the maximum threshold value of each performance metric. The length of the vector should be equal to |
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 |
attSlices |
a list; used to subset perturbed attributes in |
topReps |
an integer (default is |
climData |
data.frame; the values of |
col |
a vector of colours; The length of the vector should at least be sufficient to assign unique colours to all
the different values in the generated plot. If |
axesPercentLabel |
a logical flag; if TRUE x and y axes to be displayed in terms of percentage change instead of fraction |
If the space contains more than two perturbed attributes, the performance values are averaged across the perturbations in the attributes other than attX
and attY
.
The user may specify argument attSlices
to slice the performance space at specific values of the other perturbed attributes. If attSlices
are used to
specify minimum-maximum values to subset other perturbed attributes, the performance values are averaged across the subsetted perturbations in these attributes. This function
cannot be used with sim
perturbed on an "OAT" grid since contours of the number of performance thresholds exceeded cannot be calculated for an irregular perturbation space.
The plot showing the number of thresholds exceeded and the ggplot object.
runSystemModel
, generateScenarios
, getSimSummary
, plotPerformanceSpace
# load example datasets
data("egSimPerformance")
data("egSimSummary")
data("egClimData")
plotPerformanceSpaceMulti(performance=egSimPerformance, sim=egSimSummary,
perfThreshMin = c(NA, 0.80), perfThreshMax = c(30, NA))
#replot with axes as percentage changes
plotPerformanceSpaceMulti(performance=egSimPerformance, sim=egSimSummary,
perfThreshMin = c(NA, 0.80), perfThreshMax = c(30, NA),axesPercentLabel=TRUE)
# add alternate climate data and specify different colours for the plot
plotPerformanceSpaceMulti(performance=egSimPerformance, sim=egSimSummary,
perfThreshMin = c(NA, 0.80),perfThreshMax = c(30, NA),
climData = egClimData, col = viridisLite::magma(3))
# example using simple scaled simulations
data("egScalPerformance")
data("egScalSummary")
data("egClimData")
plotPerformanceSpaceMulti(performance=egScalPerformance, sim=egScalSummary,
perfThreshMin = c(NA, 0.80),perfThreshMax = c(30, NA),
climData = egClimData)
# replot with axes as percentage changes (Note: modifies fractional change attributes only)
plotPerformanceSpaceMulti(performance=egScalPerformance, sim=egScalSummary,
perfThreshMin = c(NA, 0.80),perfThreshMax = c(30, NA),
climData = egClimData,axesPercentLabel=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.