You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This does not occur for the specified "forecast" and "observed" columns. This means that calling as_forecast_quantile() multiple times on the same input data.table can succeed the first time and fail subsequently.
Reprex
library(scoringutils)
library(data.table)
quantile_data<- data.table(my_quantile= c(0.25, 0.5),
forecast_value= c(1, 2),
observed_value= c(5, 5))
quantile_forecast<-quantile_data|>
as_forecast_quantile(
predicted="forecast_value",
observed="observed_value",
quantile_level="my_quantile")
## the quantile_forecast output is as expectedquantile_forecast#> Forecast type: quantile#> Forecast unit:#> #> quantile_level predicted observed#> <num> <num> <num>#> 1: 0.25 1 5#> 2: 0.50 2 5## the "my_quantile" column in the input quantile_data## been renamed "quantile_level"; the "forecast_value"## and "observed_value" columns retain## their original namesquantile_data#> quantile_level forecast_value observed_value#> <num> <num> <num>#> 1: 0.25 1 5#> 2: 0.50 2 5## this now raises an error, because the column name has changed## from "my_quantile" to "quantile_level"quantile_data|>
as_forecast_quantile(
predicted="forecast_value",
observed="observed_value",
quantile_level="my_quantile")
#> Error in as_forecast_quantile.default(quantile_data, predicted = "forecast_value", : Assertion on 'quantile_level' failed: Must be a subset of {'quantile_level','forecast_value','observed_value'}, but has additional elements {'my_quantile'}.
This does not occur for the specified "forecast" and "observed" columns. This means that calling
as_forecast_quantile()
multiple times on the same inputdata.table
can succeed the first time and fail subsequently.Reprex
Created on 2025-01-03 with reprex v2.1.1
Info
scoringutils
version 2.0.0Can provide full
sessionInfo()
output if needed.The text was updated successfully, but these errors were encountered: