
Plots and Tables from an IPCC Vulnerability Index Analysis
Source:R/sus_mod_plot_vulnerability.R
sus_mod_plot_vulnerability.RdProduces city vulnerability rankings, IPCC pillar decompositions, and Lorenz
concentration curves from a climasus_vi object returned by
sus_mod_vulnerability_index().
Arguments
- x
A
climasus_viobject produced bysus_mod_vulnerability_index().- type
Character. Plot type:
"ranking"(default),"pillars", or"lorenz".- output_type
Character.
"plot"(default),"table", or"all"(named list$plot,$table,$data).- interactive
Logical.
TRUEconverts the ggplot2 output to an interactive plotly widget. DefaultFALSE.- base_size
Numeric. ggplot2 base font size. Default
12.- save_plot
Character or
NULL. File path to save the plot.- lang
Character. Language for labels:
"pt"(default),"en","es".- verbose
Logical. Print progress messages. Default
FALSE.
Value
Depending on output_type:
"plot"-> aggplotorplotlyobject."table"-> atibbleof the plotted data."all"-> a named list:$plot,$table,$data.
Plot types (type)
type | Description |
"ranking" | Horizontal lollipop of VI score per city, most vulnerable at top |
"pillars" | Stacked horizontal bar of exposure/sensitivity/AC pillar scores |
"lorenz" | Lorenz concentration curve of VI inequality across cities |
Examples
if (FALSE) { # \dontrun{
vi <- sus_mod_vulnerability_index(exposure_df = exp_df, lang = "pt")
sus_mod_plot_vulnerability(vi, type = "ranking", lang = "pt")
sus_mod_plot_vulnerability(vi, type = "pillars", lang = "en")
sus_mod_plot_vulnerability(vi, type = "lorenz", lang = "es")
out <- sus_mod_plot_vulnerability(vi, output_type = "all")
out$table
} # }