# Load Data:
input_path <- system.file("extdata/in", package = "GTAPViz")
har.plot.data <- readRDS(file.path(input_path, "har.plot.data.rds"))
# Prepare Dataframe
welfare.decomp <- har.plot.data[["A"]]
# Plot
plotC <- stack_plot(
# === Input Data ===
data = welfare.decomp,
filter_var = list(Region = "Oceania"),
x_axis_from = "Region",
stack_value_from = "COLUMN",
split_by = FALSE,
panel_var = "Experiment",
variable_col = "Variable",
unit_col = "Unit",
desc_col = "Description",
# === Plot Behavior ===
invert_axis = FALSE,
separate_figure = FALSE,
show_total = TRUE,
unstack_plot = FALSE,
top_impact = NULL,
# === Variable Display ===
var_name_by_description = TRUE,
add_var_info = FALSE,
# === Export Settings ===
output_path = NULL,
export_picture = FALSE,
export_as_pdf = FALSE,
export_config = create_export_config(width = 28, height = 15),
# === Styling ===
plot_style_config = create_plot_style(
color_tone = "gtap",
panel_rows = 2,
panel_cols = NULL,
show_legend = TRUE,
show_axis_titles_on_all_facets = FALSE
)
)
Run the code above in your browser using DataLab