Plot hubverse formatted forecasts for all or a subset of forecasted locations.
Source:R/plot_hubverse_timeseries.R
plot_hubverse_file_quantiles.Rd
Plot 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
.csv
file.- 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. Permitted formats are
"abbr"
(state/territory or nation two letter USPS abbreviation),"hub"
( legacy 2-digit FIPS code for states and territories,US
for the USA as a whole), and"long_name"
(full English jurisdiction names; not recommended). Default"abbr"
.- location_output_format
Location format for naming the entries of the output list. Accepts the same string keys as
location_input_format
.- y_transform
axis transform passed as the
transform
argument toggplot2::scale_y_continuous()
. Default"log10"
.- linewidth
linewidth
parameter passed toggplot2::geom_line()
. Default2
.- pointsize
size
parameter passed toggplot2::geom_point()
. Default4
.- forecast_linecolor
color
parameter passed toggplot2::geom_line()
for plotting forecasts. Default"darkblue"
.- forecast_pointcolor
color
parameter passed toggplot2::geom_point()
for plotting forecasts. Default"darkblue"
.- obs_linecolor
color
parameter passed toggplot2::geom_line()
for plotting observed data. Default"black"
.- obs_pointcolor
color
parameter passed toggplot2::geom_point()
for plotting observed data. Default"black"
.- autotitle
Generate a title for the individual plots from the hubverse
reference_date
and the location name? Boolean, defaultTRUE
.