Skip to contents

Produces exposure-response curve overlays, hot-vs-cold RR scatter plots, and grouped forest plots from a climasus_sensitivity object returned by sus_mod_sensitivity().

Usage

sus_mod_plot_sensitivity(
  x,
  type = c("curves", "scatter", "bar"),
  output_type = c("plot", "table", "all"),
  interactive = FALSE,
  base_size = 12L,
  save_plot = NULL,
  lang = c("pt", "en", "es"),
  verbose = FALSE
)

Arguments

x

A climasus_sensitivity object produced by sus_mod_sensitivity().

type

Character. Plot type: "curves" (default), "scatter", or "bar".

output_type

Character. "plot" (default), "table", or "all" (named list $plot, $table, $data).

interactive

Logical. TRUE converts the ggplot2 output to an interactive plotly widget. Default FALSE.

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" -> a ggplot or plotly object.

  • "table" -> a tibble of the plotted data.

  • "all" -> a named list: $plot, $table, $data.

Plot types (type)

typeDescription
"curves"Overlay of each stratum's exposure-response curve with CI ribbon
"scatter"Hot RR vs Cold RR per stratum; point size encodes sensitivity index
"bar"Horizontal forest plot of hot and cold RR per stratum ordered by SI

Examples

if (FALSE) { # \dontrun{
sens <- sus_mod_sensitivity(fits, lang = "pt")

sus_mod_plot_sensitivity(sens, type = "curves",  lang = "pt")
sus_mod_plot_sensitivity(sens, type = "scatter", lang = "en")
sus_mod_plot_sensitivity(sens, type = "bar",     lang = "es")
out <- sus_mod_plot_sensitivity(sens, output_type = "all")
out$table
} # }