Skip to contents

Aggregate and plot simulated variables saved in hru_pw_day

Usage

plot_hru_pw(
  sim_verify,
  hru_id,
  var,
  title = "",
  period = "day",
  fn_summarize = "mean",
  interactive = FALSE
)

Arguments

sim_verify

Simulation output of the function run_swat_verification(). To plot the heat units at least the output option outputs = 'mgt' must be set in run_swat_verification().

hru_id

Numeric vector with HRU ids for which variables should be plotted.

var

Character vector that defines the variable names that are plotted.

title

Character for title to be put in the figure.

period

(optional) character describing, which time interval to display (default is "day", other examples are "week", "month", etc). Default = "day"

fn_summarize

(optional) function to recalculate to time interval (default is "mean", other examples are "median", "sum", etc). Default = "mean"

interactive

(optional) Boolean TRUE to provide output as plotly object, FALSE - as ggplot. Default = "FALSE"

Value

ggplot or plotly object

Examples

if (FALSE) { # \dontrun{
id <- get_hru_id_by_attribute(sim_nostress, "wwht_lum")
plot_hru_pw(sim_nostress, sample(id$id, 10), "lai")
plot_hru_pw(sim_nostress, hru_id = c(2, 10), var = c("lai", "bioms"),
title = "My great figure", period = "year", fn_summarize = "mean", interactive = TRUE)
} # }