View source: R/get-forecast-counts.R
get_forecast_counts | R Documentation |
Given a data set with forecasts, this function counts the number of
available forecasts.
The level of grouping can be specified using the by
argument (e.g. to
count the number of forecasts per model, or the number of forecasts per
model and location).
This is useful to determine whether there are any missing forecasts.
get_forecast_counts(
forecast,
by = get_forecast_unit(forecast),
collapse = c("quantile_level", "sample_id")
)
forecast |
A forecast object (a validated data.table with predicted and observed values). |
by |
character vector or |
collapse |
character vector (default: |
A data.table with columns as specified in by
and an additional
column "count" with the number of forecasts.
library(magrittr) # pipe operator
example_quantile %>%
as_forecast_quantile() %>%
get_forecast_counts(by = c("model", "target_type"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.