Description Usage Arguments Value Examples
View source: R/figures_manuscript.R
Plot state variables
1 2 3 4 5 6 7 8 9 | plot_state_vars(
time_series = ts_data,
bloom_fert_df = bloom_fert_dates,
var_rename_vec = c(`Chl-a (ug/L)` = "Manual_Chl", `BGA (cells/mL)` = "BGA_HYLB",
`D.O. sat. (%)` = "DO_Sat", pH = "pH"),
lakes_rename_vec = c(Reference = "L", Experimental = "R"),
lake_colors = c(Experimental = "firebrick3", Reference = "royalblue3"),
legend_location = c(0.13, 0.9)
)
|
time_series |
data frame containing time series of state variables, , see |
bloom_fert_df |
data frame of fertilization start and end and bloom start dates, see |
var_rename_vec |
named vector, used to change variable names displayed in plot, format is c("new name" = "original name") |
lakes_rename_vec |
named vector, used to change lake names displayed in plot, format is c("new name" = "original name") |
lake_colors |
named vector, used to specify colors for each lake, format is c("Lake" = "color") |
legend_location |
numerical vector of length 2, has c(x, y) position for placing legend on plot |
ggplot object plotting the time series
1 2 3 4 5 6 7 8 | # all data:
plot_state_vars()
# just latest experiment
plot_state_vars(
time_series = ts_data %>% dplyr::filter(Year >= 2018),
bloom_fert_df = bloom_fert_dates %>% dplyr::filter(Lake == "R" & Year >= 2018)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.