
Plot sensitivity and uncertainty analysis results
plot_sa.RdPlotting interface and S3 plot() method for cba_uncertainty objects
generated by perform_sa().
Arguments
- x
An object of class
cba_uncertainty(as returned byperform_sa()), or a compatible list or data frame.- type
Character scalar specifying the plot layout:
"both"(default),"uncertainty","sobol", or"triplet".- indicator
Character scalar specifying the target indicator:
"npv"(default) or"benefit".- sobol_order
Character scalar specifying which Sobol indices to display:
"both"(default),"total", or"first".- lang
Character scalar, language for labels:
"en"(default), with 11 ISO 639-1 languages supported.- dir_output
Character scalar, destination directory for exported files (defaults to
tempdir()). Ignored whendevice = "active".- device
Character scalar specifying the graphics device:
"active"(default, render to active device),"pdf","png","jpg","jpeg", or"svg".- ...
Additional graphical arguments passed to underlying plotting functions.
Value
An invisible character scalar giving the path of the generated file
when device != "active", or invisible NULL when device = "active".
Details
Dispatches graphical representations according to type:
"both": two-panel layout combiningplot_uncertainty()on top andplot_sobol()below."uncertainty": single uncertainty distribution plot (histogram/density) viaplot_uncertainty()."sobol": Sobol sensitivity index barplot viaplot_sobol()."triplet": multi-panel 3-parameter sensitivity maps and marginal distributions viaplot_sa_triplet().
When device != "active", the graphic is rendered into a file in dir_output
whose name is automatically formatted as <case>-<project>-<graphic>-<lang>.<device>.
Author
Frédéric Grelot, frederic.grelot.1994_cran@m4x.org
Examples
case = import_case(
system.file("extdata", "case", "simple.ods", package = "floodam.cba")
)
#> import Case from /tmp/RtmpvMoJJK/temp_libpath2b69f6f14b9e9/floodam.cba/extdata/case/simple.ods
#> ... done
res = perform_sa(case, n = 50, verbose = FALSE)
plot(res, type = "uncertainty")
plot(res, type = "sobol")