plot_temporal_EWS: Plot rolling window stats and quickest detection alarms for...

Description Usage Arguments Value Examples

Description

Plot rolling window stats and quickest detection alarms for all variables

Usage

1
2
3
4
5
6
7
8
plot_temporal_EWS(
  rolling_window_stats,
  qd_alarms,
  bloom_fert_df = bloom_fert_dates,
  var_rename_vec = c(`Chl-a` = "Manual_Chl", Phyco = "BGA_HYLB", `D.O. sat.` =
    "DO_Sat", pH = "pH"),
  legend_location = c(0.13, 0.9)
)

Arguments

rolling_window_stats

data frame, output from call to calc_rolling_stats

qd_alarms

data frame, output from call to format_qd

bloom_fert_df

data frame of fertilization start and end and bloom start dates, see bloom_fert_dates for default and formatting

var_rename_vec

named vector, used to change variable names displayed in plot, format is c("new name" = "original name")

legend_location

numerical vector of length 2, has c(x, y) position for placing legend on plot

Value

ggplot object showing rolling window statistics and quickest detection alarms

Examples

1
2
3
4
5
6
use_vars <- c("Manual_Chl", "BGA_HYLB", "DO_Sat", "pH")
rw_stats <- calc_rolling_stats(ts_data, var_cols = use_vars)
qd_s <- run_qd(rw_stats, var_cols = use_vars)
qd_a <- format_qd(qd_s, bloom_fert_df = bloom_fert_dates)
plot_temporal_EWS(rolling_window_stats = rw_stats,
  qd_alarms = qd_a, bloom_fert_df = bloom_fert_dates)

cbuelo/tvsews documentation built on Jan. 21, 2022, 1:31 a.m.