temp <- structure(list(model = c("CADPH-FluCAT_Ensemble", "CADPH-FluCAT_Ensemble",
"CADPH-FluCAT_Ensemble", "CADPH-FluCAT_Ensemble", "CADPH-FluCAT_Ensemble",
"CADPH-FluCAT_Ensemble"), reference_date = structure(c(19644,
19644, 19644, 19644, 19644, 19644), class = "Date"), target = c("wk inc flu hosp",
"wk inc flu hosp", "wk inc flu hosp", "wk inc flu hosp", "wk inc flu hosp",
"wk inc flu hosp"), horizon = c(0L, 0L, 0L, 0L, 0L, 0L), target_end_date = structure(c(19644,
19644, 19644, 19644, 19644, 19644), class = "Date"), location = c("06",
"06", "06", "06", "06", "06"), output_type = c("quantile", "quantile",
"quantile", "quantile", "quantile", "quantile"), quantile = c("0.01",
"0.025", "0.05", "0.1", "0.15", "0.2"), prediction = c(24.7394276619984,
28.1962221056035, 31.1951151171218, 34.644079800571, 36.9984603087119,
38.8655576919876), true_value = c(61, 61, 61, 61, 61, 61)), row.names = c(NA,
-6L), class = c("model_out_tbl", "tbl_df", "tbl", "data.frame"
))
temp
> temp
# # A tibble: 6 × 10
# model reference_date target horizon target_end_date location output_type quantile prediction true_value
# <chr> <date> <chr> <int> <date> <chr> <chr> <chr> <dbl> <dbl>
# 1 CADPH-FluCAT_Ensemble 2023-10-14 wk inc flu hosp 0 2023-10-14 06 quantile 0.01 24.7 61
# 2 CADPH-FluCAT_Ensemble 2023-10-14 wk inc flu hosp 0 2023-10-14 06 quantile 0.025 28.2 61
# 3 CADPH-FluCAT_Ensemble 2023-10-14 wk inc flu hosp 0 2023-10-14 06 quantile 0.05 31.2 61
# 4 CADPH-FluCAT_Ensemble 2023-10-14 wk inc flu hosp 0 2023-10-14 06 quantile 0.1 34.6 61
# 5 CADPH-FluCAT_Ensemble 2023-10-14 wk inc flu hosp 0 2023-10-14 06 quantile 0.15 37.0 61
# 6 CADPH-FluCAT_Ensemble 2023-10-14 wk inc flu hosp 0 2023-10-14 06 quantile 0.2 38.9 61
> scoringutils::set_forecast_unit(temp, c("model", "reference_date", "target", "horizon", "target_end_date", "location"))
Error in `[.tbl_df`(data, , .SD, .SDcols = keep_cols) :
object '.SD' not found
Enter a frame number, or 0 to exit
1: scoringutils::set_forecast_unit(temp, c("model", "reference_date", "target", "horizon", "target_end_date", "location"))
2: unique(data[, .SD, .SDcols = keep_cols])
3: data[, .SD, .SDcols = keep_cols]
4: `[.tbl_df`(data, , .SD, .SDcols = keep_cols)
I'm working with the version of scoringutils that you get by installing from github.
When attempting to call
set_forecast_unit, I get an error. Here's an illustration with a small subset of the data that I'm working with:I'm working with the version of scoringutils that you get by installing from github.