Plot hubverse formatted forecasts for all or a subset of forecasted locations.
Source:R/plot_hubverse_timeseries.R
plot_hubverse_file_quantiles.RdPlot quantiles given hubverse formatted data for all locations in the dataset or a subset of them.
Usage
plot_hubverse_file_quantiles(
forecast_file_path,
locations = NULL,
observed_data_path = NULL,
start_date = NULL,
end_date = NULL,
location_input_format = "abbr",
location_output_format = "abbr",
y_transform = "log10",
linewidth = 2,
pointsize = 4,
forecast_linecolor = "darkblue",
forecast_pointcolor = "darkblue",
obs_linecolor = "black",
obs_pointcolor = "black",
autotitle = TRUE
)Arguments
- forecast_file_path
path to hubverse- formatted forecast data, as a single
.csvfile.- locations
set of locations to plot. If NULL, all locations are plotted. Otherwise, a vector of location values to plot, as USPS-style abbreviations (e.g.
c("US", "AL", "AK"), US hubverse submission location codes ( e.g.c("US", 01, 02)), or full English jurisdiction names (e.g.c("United States, "Alabama", "Alaska"). DefaultNULL.- observed_data_path
path to observed data to plot alongside the forecast quantiles. If
NULL, only the forecast quantiles will be plotted. DefaultNULL.- start_date
first date to plot. If NULL, defaults to the earliest date found between the forecast timeseries ( obtained from
forecast_file_path) and the observed data timeseries (obtained fromobserved_data_path, if provided). Default NULL.- end_date
final date to plot. If NULL, defaults to the latest date found between the forecast timeseries ( obtained from
forecast_file_path) and the observed data timeseries (obtained fromobserved_data_path, if provided). Default NULL.- location_input_format
Format of the provided location vector. See
to_us_location_table_column()for valid formats.- location_output_format
Location format for naming the entries of the output list. See
to_us_location_table_column()for valid formats.- y_transform
axis transform passed as the
transformargument toggplot2::scale_y_continuous(). Default"log10".- linewidth
linewidthparameter passed toggplot2::geom_line(). Default2.- pointsize
sizeparameter passed toggplot2::geom_point(). Default4.- forecast_linecolor
colorparameter passed toggplot2::geom_line()for plotting forecasts. Default"darkblue".- forecast_pointcolor
colorparameter passed toggplot2::geom_point()for plotting forecasts. Default"darkblue".- obs_linecolor
colorparameter passed toggplot2::geom_line()for plotting observed data. Default"black".- obs_pointcolor
colorparameter passed toggplot2::geom_point()for plotting observed data. Default"black".- autotitle
Generate a title for the individual plots from the hubverse
reference_dateand the location name? Boolean, defaultTRUE.