Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/pairwise-comparisons.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ add_rel_skill_to_eval_forecasts <- function(unsummarised_scores,
# also delete skill metric from output
out[, eval(rel_skill_metric) := NULL]

return(out)
return(out[])
}


Expand Down Expand Up @@ -305,7 +305,7 @@ pairwise_comparison_one_group <- function(scores,
data.table::setnames(out, old = c("ratio", "theta", "rel_to_baseline"),
new = c("mean_scores_ratio", "relative_skill", "scaled_rel_skill"))

return(out)
return(out[])
}


Expand Down
22 changes: 11 additions & 11 deletions R/utils_data_handling.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ range_long_to_wide <- function(data) {
out <- data.table::dcast(data, ... ~ boundary + range,
value.var = "prediction")

return(out)
return(out[])
}


Expand All @@ -45,7 +45,7 @@ range_long_to_wide <- function(data) {
quantile_to_wide <- function(data) {
warning("This function will be deprecated. Please use `range_long_to_wide()` in the future")
out <- scoringutils::range_long_to_wide(data)
return(out)
return(out[])
}


Expand Down Expand Up @@ -120,7 +120,7 @@ range_wide_to_long <- function(data) {
quantile_to_long <- function(data) {
warning("This function will be deprecated. Please use `range_wide_to_long()` in the future")
out <- scoringutils::range_wide_to_long(data)
return(out)
return(out[])
}


Expand Down Expand Up @@ -173,7 +173,7 @@ range_long_to_quantile <- function(data,
}


return(unique(data))
return(unique(data)[])
}


Expand All @@ -188,7 +188,7 @@ range_to_quantile <- function(data,
keep_range_col = FALSE) {
warning("This function will be deprecated. Please use `range_long_to_quantile()` in the future")
out <- scoringutils::range_long_to_quantile(data, keep_range_col)
return(out)
return(out[])
}


Expand Down Expand Up @@ -246,7 +246,7 @@ quantile_to_range_long <- function(data,
data[, `:=`(boundary = as.character(boundary),
range = as.numeric(range))]

return(data)
return(data[])
}


Expand All @@ -261,7 +261,7 @@ quantile_to_range <- function(data,
keep_quantile_col = FALSE) {
warning("This function will be deprecated. Please use `quantile_to_range_long()` in the future")
out <- scoringutils::quantile_to_range_long(data, keep_quantile_col)
return(out)
return(out[])
}


Expand Down Expand Up @@ -306,7 +306,7 @@ sample_to_quantile <- function(data,
type = type, na.rm = TRUE)),
by = by]

return(data)
return(data[])
}


Expand Down Expand Up @@ -354,7 +354,7 @@ sample_to_range_long <- function(data,
data <- scoringutils::quantile_to_range_long(data,
keep_quantile_col = keep_quantile_col)

return(data)
return(data[])
}


Expand All @@ -372,7 +372,7 @@ sample_to_range <- function(data,
keep_quantile_col = TRUE) {
warning("This function will be deprecated. Please use `sample_to_range-long()` in the future")
out <- scoringutils::sample_to_range_long(data, range, type, keep_quantile_col)
return(out)
return(out[])
}


Expand Down Expand Up @@ -450,7 +450,7 @@ merge_pred_and_obs <- function(forecasts, observations,
combined[, paste0(basenames_overlap, ".y") := NULL]
}

return(combined)
return(combined[])
}


Expand Down