Plot a hubverse formatted quantile forecast timeseries for a single location.
Source:R/plot_hubverse_timeseries.R
plot_hubverse_loc_quant_ts.Rd
Given a tibble of data properly formatted for a hubverse schema forecast hub submission, plot a timeseries of quantile predictions for a given location.
Usage
plot_hubverse_loc_quant_ts(
location,
forecast_data,
observed_data,
location_format = "abbr",
y_transform = "log10",
linewidth = 2,
pointsize = 4,
forecast_linecolor = "darkblue",
forecast_pointcolor = "darkblue",
obs_linecolor = "black",
obs_pointcolor = "black",
target_name = NULL,
autotitle = TRUE
)
Arguments
- location
location to plot
- forecast_data
hubverse format quantile forecast data, as a
tibble
.- observed_data
observed data, as a
tibble
.- location_format
format of the provided location. 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"
.- 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"
.- target_name
Name of the forecast target, for labeling the plot y-axis. Default
NULL
, in which case a value from thetarget
column inforecast_data
will be used.- autotitle
Boolean. Generate an automatic title for the plot from the location name and reference date? Default
TRUE
.