Visualise Where Forecasts Are Available
show_avail_forecasts(
data,
y = "model",
x = "forecast_date",
make_x_factor = TRUE,
summarise_by = NULL,
collapse_to_one = TRUE,
by = NULL,
show_numbers = TRUE,
facet_formula = NULL,
facet_wrap_or_grid = "facet_wrap",
scales = "fixed",
legend_position = "none"
)
data.frame with predictions in the same format required for
eval_forecasts
character vector of length one that denotes the name of the column to appear on the y-axis of the plot
character vector of length one that denotes the name of the column to appear on the x-axis of the plot
logical (default is TRUE). Whether or not to convert the variable on the x-axis to a factor. This has an effect e.g. if dates are shown on the x-axis.
character vector or NULL
(the default) that
denotes the categories over which the number of forecasts should be summed
up. By default (i.e. summarise_by = NULL
) this will be all the
columns that appear in either x, y, or the facetting formula.
logical. If TRUE
) (the default), everything
not included in by
will be counted only once. This is useful, for
example, if you don't want to count every single sample or quantile, but
instead treat one set of samples or quantiles as one forecast.
character vector or NULL
(the default) that denotes the
unit of an individual forecast. This argument behaves similarly to the
by
argument in link{eval_forecasts}
. By default, all columns
are used that are not part of any internally protected columns like "sample"
or "prediction" or similar. The by
argument is only necessary if
collapse_to_one = TRUE
to indicate which rows not to collapse to one.
logical (default is TRUE
) that indicates whether
or not to show the actual count numbers on the plot
formula for facetting in ggplot. If this is NULL
(the default), no facetting will take place
character. Use ggplot2's facet_wrap
or
facet_grid
? Anything other than "facet_wrap" will be interpreted as
facet_grid
. This only takes effect if facet_formula
is not
NULL
character. The scales argument gets passed down to ggplot. Only necessary if you make use of facetting. Default is "fixed"
character that indicates where to put the legend. The argument gets passed to ggplot2. By default ("none"), no legend is shown.
ggplot object with a plot of interval coverage
# NOT RUN {
example1 <- scoringutils::range_example_data_long
show_avail_forecasts(example1, x = "value_date", facet_formula = ~ value_desc)
# }
Run the code above in your browser using DataLab