
Plots and Tables from a Climate-Health SWOT Analysis
Source:R/sus_mod_plot_swot.R
sus_mod_plot_swot.RdProduces radar (spider), matrix (2x2 SWOT board), and bar charts from a
climasus_swot object returned by sus_mod_swot().
Arguments
- x
A
climasus_swotobject fromsus_mod_swot().- type
Character. Plot type:
"radar"(default),"matrix", or"bar".- output_type
Character.
"plot"(default),"table", or"all"(named list$plot,$table).- interactive
Logical. Convert the ggplot2 output to an interactive plotly widget. Default
FALSE.- entities
Character vector or
NULL. Subset of entity names to plot.NULL(default) plots all entities. Fortype = "matrix", only the first entity in the selection is shown.- top_n
Integer. For
type = "matrix", maximum number of indicator bullets to display per quadrant. Default3L.- base_size
Numeric. ggplot2 base font size. Default
12.- save_plot
Character or
NULL. File path to save the plot (PNG/PDF).- 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.
Plot types (type)
type | Description |
"radar" | Spider/radar chart of the four quadrant scores (0-100) per entity |
"matrix" | Classic 2x2 SWOT board: score, category label, and top indicators for each quadrant. Best for a single entity. |
"bar" | Grouped horizontal bars comparing all four quadrant scores per entity |
Examples
if (FALSE) { # \dontrun{
swot <- sus_mod_swot(vulnerability = vi, af = af_res, lang = "pt")
sus_mod_plot_swot(swot, type = "matrix", lang = "pt")
sus_mod_plot_swot(swot, type = "radar", lang = "en")
sus_mod_plot_swot(swot, type = "bar", interactive = TRUE)
out <- sus_mod_plot_swot(swot, output_type = "all")
} # }