# \donttest{
# Load example GHRmodels object from the package:
model_list_file <- system.file("examples", "model_list.rds", package = "GHRmodel")
model_list <- readRDS(model_list_file)
# Plot observed vs. fitted cases over time for three selected models
plot_fit(
models = model_list, # A GHRmodels object containing the fitted models
mod_id = c("mod1", "mod3", "mod5"), # Vector of model IDs to plot
mod_label = c("Baseline", # Custom display names
"tmin.l1.nl",
"pdsi.l1.nl_tmin.l1.nl"),
ref_color = "grey", # Color for the reference model
time = "date", # Name of the time variable
palette = "Set2", # Color palette for fitted lines
xlim = c("2010-01-01", "2020-01-01"), # Limit x-axis to this date range
title = "Fitted vs Observed" # Main plot title
)
# }
Run the code above in your browser using DataLab