Generates an interactive plotly time series plot from a data frame, optionally overlaying phenological events.
Usage
visualize_time_series(
df_ts,
df_doy = NULL,
var = "value",
ylab = "Value",
smooth = FALSE,
lambda = 50,
facet_var = NULL,
color_palette = "viridis"
)Arguments
- df_ts
Data frame. Must contain either a
time(POSIX) ordate(Date) column, anidcolumn, and the variable to plot.- df_doy
Optional data frame. Time of phenological events with columns
yearanddoy. Default:NULL.- var
Character. Name of the column in
df_tsto plot (default:"value").- ylab
Character. Label for the y-axis (default:
"Value").- smooth
Logical. If
TRUE, applies gap-filling and smoothing to data points with Whittaker smoothing (default:FALSE).- lambda
Numeric. Smoothing parameter for Whittaker smoothing (default: 50).
- facet_var
Character or
NULL. Column name indf_tsanddf_doyto facet by (e.g.,"site"or"id").- color_palette
Character. Name of a viridis palette for line colors (default:
"viridis").