From e4f8238be40422513fe1b4cb9446fbcc19701db9 Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Tue, 28 Nov 2023 13:19:38 +0100 Subject: [PATCH] fix linting issues --- NAMESPACE | 2 +- R/add_coverage.R | 8 +-- R/available_forecasts.R | 2 +- R/data.R | 35 ++++++++++---- R/metrics-quantile.R | 67 +++++++++++++------------- R/metrics-sample.R | 4 +- R/pairwise-comparisons.R | 10 ++-- R/pit.R | 8 +-- R/plot.R | 2 +- R/score.R | 19 ++++---- R/summarise_scores.R | 4 +- R/utils.R | 7 ++- R/utils_data_handling.R | 6 ++- man/example_binary.Rd | 4 +- man/example_continuous.Rd | 4 +- man/example_integer.Rd | 3 ++ man/example_point.Rd | 4 +- man/example_quantile.Rd | 4 +- man/example_quantile_forecasts_only.Rd | 4 +- man/example_truth_only.Rd | 4 +- man/metrics_quantile.Rd | 8 +-- vignettes/metric-details.Rmd | 2 +- vignettes/scoringutils.Rmd | 2 +- 23 files changed, 120 insertions(+), 93 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index e6c530dd3..92ba7b975 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -31,8 +31,8 @@ export(crps_sample) export(dispersion) export(dss_sample) export(get_duplicate_forecasts) -export(get_forecast_unit) export(get_forecast_type) +export(get_forecast_unit) export(interval_coverage_deviation_quantile) export(interval_coverage_quantile) export(interval_coverage_sample) diff --git a/R/add_coverage.R b/R/add_coverage.R index 684556026..4620e81d5 100644 --- a/R/add_coverage.R +++ b/R/add_coverage.R @@ -51,13 +51,9 @@ add_coverage <- function(data) { forecast_unit <- get_forecast_unit(data) data_cols <- colnames(data) # store so we can reset column order later - # what happens if quantiles are not symmetric around the median? - # should things error? Also write tests for that. interval_data <- quantile_to_interval(data, format = "wide") - interval_data[, interval_coverage := ifelse( - observed <= upper & observed >= lower, - TRUE, - FALSE) + interval_data[ + , interval_coverage := (observed <= upper) & (observed >= lower) ][, c("lower", "upper", "observed") := NULL] data[, range := get_range_from_quantile(quantile)] diff --git a/R/available_forecasts.R b/R/available_forecasts.R index 17418b0a6..15f9a5e6b 100644 --- a/R/available_forecasts.R +++ b/R/available_forecasts.R @@ -58,7 +58,7 @@ available_forecasts <- function(data, data <- data[data[, .I[1], by = collapse_by]$V1] # count number of rows = number of forecasts - out <- data[, .(`count` = .N), by = by] + out <- data[, .(count = .N), by = by] # make sure that all combinations in "by" are included in the output (with # count = 0). To achieve that, take the unique values in data and expand grid diff --git a/R/data.R b/R/data.R index c57e044d8..448ae1fa5 100644 --- a/R/data.R +++ b/R/data.R @@ -19,7 +19,9 @@ #' \item{model}{name of the model that generated the forecasts} #' \item{horizon}{forecast horizon in weeks} #' } -#' @source \url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +#' @source \url{https://github.com/covid19-forecast-hub-europe/ +#' covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +#' } "example_quantile" @@ -44,7 +46,9 @@ #' \item{model}{name of the model that generated the forecasts} #' \item{horizon}{forecast horizon in weeks} #' } -#' @source \url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +#' @source \url{https://github.com/covid19-forecast-hub-europe/ +#' covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +#' } "example_point" @@ -69,7 +73,9 @@ #' \item{predicted}{predicted value} #' \item{sample_id}{id for the corresponding sample} #' } -#' @source \url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +#' @source \url{https://github.com/covid19-forecast-hub-europe/ +#' covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +#' } "example_continuous" @@ -94,6 +100,9 @@ #' \item{predicted}{predicted value} #' \item{sample_id}{id for the corresponding sample} #' } +#' #' @source \url{https://github.com/covid19-forecast-hub-europe/ +#' covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +#' } "example_integer" @@ -124,7 +133,9 @@ #' \item{horizon}{forecast horizon in weeks} #' \item{predicted}{predicted value} #' } -#' @source \url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +#' @source \url{https://github.com/covid19-forecast-hub-europe/ +#' covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +#' } "example_binary" @@ -147,7 +158,9 @@ #' \item{model}{name of the model that generated the forecasts} #' \item{horizon}{forecast horizon in weeks} #' } -#' @source \url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +#' @source \url{https://github.com/covid19-forecast-hub-europe/ +#' covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +#' } "example_quantile_forecasts_only" @@ -167,7 +180,9 @@ #' \item{observed}{observed values} #' \item{location_name}{name of the country for which a prediction was made} #' } -#' @source \url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +#' @source \url{https://github.com/covid19-forecast-hub-europe/ +#' covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +#' } "example_truth_only" #' Summary information for selected metrics @@ -215,13 +230,15 @@ #' Default metrics for quantile-based forecasts. #' #' A named list with functions: -#' - "wis" = [wis()] +#' - "wis" = [wis] #' - "overprediction" = [overprediction()] #' - "underprediction" = [underprediction()] #' - "dispersion" = [dispersion()] #' - "bias" = [bias_quantile()] -#' - "coverage_50" = \(...) {run_safely(..., range = 50, fun = [interval_coverage_quantile][interval_coverage_quantile()])} -#' - "coverage_90" = \(...) {run_safely(..., range = 90, fun = [interval_coverage_quantile][interval_coverage_quantile()])} +#' - "coverage_50" = [interval_coverage_quantile()] +#' - "coverage_90" = \(...) \{ +#' run_safely(..., range = 90, fun = [interval_coverage_quantile]) +#' \} #' - "coverage_deviation" = [interval_coverage_deviation_quantile()], #' - "ae_median" = [ae_median_quantile()] #' @keywords info diff --git a/R/metrics-quantile.R b/R/metrics-quantile.R index 50f729f15..caa74a84b 100644 --- a/R/metrics-quantile.R +++ b/R/metrics-quantile.R @@ -119,25 +119,26 @@ wis <- function(observed, reformatted[, eval(cols) := do.call( interval_score, - list(observed = observed, - lower = lower, - upper = upper, - interval_range = range, - weigh = weigh, - separate_results = separate_results + list( + observed = observed, + lower = lower, + upper = upper, + interval_range = range, + weigh = weigh, + separate_results = separate_results ) )] - if (!count_median_twice) { - reformatted[, weight := ifelse(range == 0, 0.5, 1)] - } else { + if (count_median_twice) { reformatted[, weight := 1] + } else { + reformatted[, weight := ifelse(range == 0, 0.5, 1)] } # summarise results by forecast_id reformatted <- reformatted[ , lapply(.SD, weighted.mean, na.rm = na.rm, w = weight), - by = c("forecast_id"), + by = "forecast_id", .SDcols = colnames(reformatted) %like% paste(cols, collapse = "|") ] @@ -225,15 +226,14 @@ interval_coverage_quantile <- function(observed, predicted, quantile, range = 50 if (!all(necessary_quantiles %in% quantile)) { warning( "To compute the coverage for a range of ", range, "%, the quantiles ", - necessary_quantiles, " are required. Returning `NA`.") + necessary_quantiles, " are required. Returning `NA`." + ) return(NA) } r <- range reformatted <- quantile_to_interval(observed, predicted, quantile) reformatted <- reformatted[range %in% r] - reformatted[, coverage := ifelse( - observed >= lower & observed <= upper, TRUE, FALSE - )] + reformatted[, coverage := (observed >= lower) & (observed <= upper)] return(reformatted$coverage) } @@ -298,26 +298,24 @@ interval_coverage_deviation_quantile <- function(observed, predicted, quantile) available_ranges <- unique(get_range_from_quantile(quantile)) # check if all necessary quantiles are available - necessary_quantiles <- unique(c( - (100 - available_ranges) / 2, - 100 - (100 - available_ranges) / 2) / 100 + necessary_quantiles <- unique( + c((100 - available_ranges) / 2, 100 - (100 - available_ranges) / 2) / 100 ) if (!all(necessary_quantiles %in% quantile)) { missing <- necessary_quantiles[!necessary_quantiles %in% quantile] warning( "To compute coverage deviation, all quantiles must form central ", "symmetric prediction intervals. Missing quantiles: ", - toString(missing), ". Returning `NA`.") + toString(missing), ". Returning `NA`." + ) return(NA) } reformatted <- quantile_to_interval(observed, predicted, quantile)[range != 0] - reformatted[, coverage := ifelse( - observed >= lower & observed <= upper, TRUE, FALSE - )] + reformatted[, coverage := (observed >= lower) & (observed <= upper)] reformatted[, coverage_deviation := coverage - range / 100] out <- reformatted[, .(coverage_deviation = mean(coverage_deviation)), - by = c("forecast_id")] + by = "forecast_id"] return(out$coverage_deviation) } @@ -391,7 +389,7 @@ bias_quantile <- function(observed, predicted, quantile, na.rm = TRUE) { dim(predicted) <- c(n, N) } bias <- sapply(1:n, function(i) { - bias_quantile_single_vector(observed[i], predicted[i,], quantile, na.rm) + bias_quantile_single_vector(observed[i], predicted[i, ], quantile, na.rm) }) return(bias) } @@ -416,14 +414,14 @@ bias_quantile_single_vector <- function(observed, predicted, quantile, na.rm) { predicted_has_NAs <- anyNA(predicted) quantile_has_NAs <- anyNA(quantile) - if(any(predicted_has_NAs, quantile_has_NAs)) { - if (!na.rm) { - return(NA_real_) - } else { + if (any(predicted_has_NAs, quantile_has_NAs)) { + if (na.rm) { quantile <- quantile[!is.na(predicted)] predicted <- predicted[!is.na(predicted)] predicted <- predicted[!is.na(quantile)] quantile <- quantile[!is.na(quantile)] + } else { + return(NA_real_) } } @@ -616,12 +614,13 @@ wis_one_to_one <- function(observed, reformatted <- quantile_to_interval(observed, predicted, quantile) reformatted[, eval(cols) := do.call( interval_score, - list(observed = observed, - lower = lower, - upper = upper, - interval_range = range, - weigh = weigh, - separate_results = separate_results + list( + observed = observed, + lower = lower, + upper = upper, + interval_range = range, + weigh = weigh, + separate_results = separate_results ) )] @@ -665,7 +664,7 @@ wis_one_to_one <- function(observed, if (output == "matrix") { wis <- matrix(wis, nrow = n, ncol = N) if (separate_results) { - components <- lapply(components, function(x) matrix(x, nrow = n, ncol = N)) + components <- lapply(components, matrix, nrow = n, ncol = N) return(c(wis, components)) } else { return(wis) diff --git a/R/metrics-sample.R b/R/metrics-sample.R index 803fb4c4e..81d62e8fc 100644 --- a/R/metrics-sample.R +++ b/R/metrics-sample.R @@ -313,9 +313,7 @@ interval_coverage_sample <- function(observed, predicted, range = 50) { # this could call interval_coverage_quantile instead # ========================================================== interval_dt <- quantile_to_interval(quantile_dt, format = "wide") - interval_dt[, coverage := ifelse( - observed >= lower & observed <= upper, TRUE, FALSE - )] + interval_dt[, coverage := (observed >= lower) & (observed <= upper)] # ========================================================== return(interval_dt$coverage) } diff --git a/R/pairwise-comparisons.R b/R/pairwise-comparisons.R index eab561adb..525d1bca6 100644 --- a/R/pairwise-comparisons.R +++ b/R/pairwise-comparisons.R @@ -66,10 +66,10 @@ pairwise_comparison <- function(scores, baseline = NULL, ...) { metric <- match.arg(metric, c("auto", available_metrics())) - if (!is.data.table(scores)) { - scores <- as.data.table(scores) - } else { + if (is.data.table(scores)) { scores <- copy(scores) + } else { + scores <- as.data.table(scores) } # determine metric automatically @@ -228,8 +228,8 @@ pairwise_comparison_one_group <- function(scores, # make result character instead of factor result[, `:=`( - "model" = as.character(model), - "compare_against" = as.character(compare_against) + model = as.character(model), + compare_against = as.character(compare_against) )] # calculate relative skill as geometric mean diff --git a/R/pit.R b/R/pit.R index ee5e09c7c..bc7224596 100644 --- a/R/pit.R +++ b/R/pit.R @@ -125,10 +125,10 @@ pit_sample <- function(observed, # check data type ------------------------------------------------------------ # check whether continuous or integer - if (!isTRUE(all.equal(as.vector(predicted), as.integer(predicted)))) { - continuous_predictions <- TRUE - } else { + if (isTRUE(all.equal(as.vector(predicted), as.integer(predicted)))) { continuous_predictions <- FALSE + } else { + continuous_predictions <- TRUE } # calculate PIT-values ------------------------------------------------------- @@ -209,7 +209,7 @@ pit <- function(data, value.var = "predicted" ) - pit <- data_wide[, .("pit_value" = pit_sample( + pit <- data_wide[, .(pit_value = pit_sample( observed = observed, predicted = as.matrix(.SD) )), diff --git a/R/plot.R b/R/plot.R index 0ec4bb8c1..0c057d40d 100644 --- a/R/plot.R +++ b/R/plot.R @@ -470,7 +470,7 @@ plot_predictions <- function(data, # it separately here to deal with the case when only the median is provided # (in which case ggdist::geom_lineribbon() will fail) if (0 %in% range) { - select_median <- (forecasts$range %in% 0 & forecasts$boundary == "lower") + select_median <- (forecasts$range == 0 & forecasts$boundary == "lower") median <- forecasts[select_median] if (nrow(median) > 0) { diff --git a/R/score.R b/R/score.R index 29230e6e0..ae50d1a28 100644 --- a/R/score.R +++ b/R/score.R @@ -229,11 +229,13 @@ score.scoringutils_quantile <- function(data, metrics = metrics_quantile, ...) { # transpose the forecasts that belong to the same forecast unit # make sure the quantiles and predictions are ordered in the same way - d_transposed <- data[, .(predicted = list(predicted[order(quantile)]), - observed = unique(observed), - quantile = list(quantile[order(quantile)]), - scoringutils_quantile = toString(quantile[order(quantile)])), - by = forecast_unit] + d_transposed <- data[, .( + predicted = list(predicted[order(quantile)]), + observed = unique(observed), + quantile = list(sort(quantile, na.last = TRUE)), + scoringutils_quantile = toString(sort(quantile, na.last = TRUE)) + ), + by = forecast_unit] # split according to quantile lengths and do calculations for different # quantile lengths separately. The function `wis()` assumes that all @@ -265,12 +267,9 @@ apply_metrics <- function(data, metrics, ...) { data[, (metric_name) := do.call(run_safely, list(..., fun = fun))] ) lapply(seq_along(metrics), function(i, data, ...) { - metric_name <- names(metrics[i]) - fun <- metrics[[i]] + metric_name <- names(metrics[i]) # nolint + fun <- metrics[[i]] # nolint eval(expr) }, data, ...) return(data) } - - - diff --git a/R/summarise_scores.R b/R/summarise_scores.R index f71a0f7cc..4e010e9bd 100644 --- a/R/summarise_scores.R +++ b/R/summarise_scores.R @@ -114,8 +114,8 @@ summarise_scores <- function(scores, stored_attributes <- c( get_scoringutils_attributes(scores), list( - "scoringutils_by" = by, - "unsummarised_scores" = scores + scoringutils_by = by, + unsummarised_scores = scores ) ) diff --git a/R/utils.R b/R/utils.R index 53a2d800e..2462a6339 100644 --- a/R/utils.R +++ b/R/utils.R @@ -262,11 +262,10 @@ run_safely <- function(..., fun) { #' @keywords internal #' @importFrom data.table copy is.data.table as.data.table ensure_data.table <- function(data) { - if (!is.data.table(data)) { - data <- as.data.table(data) - } else { + if (is.data.table(data)) { data <- copy(data) + } else { + data <- as.data.table(data) } return(data) } - diff --git a/R/utils_data_handling.R b/R/utils_data_handling.R index 1b1302dbf..1034e9609 100644 --- a/R/utils_data_handling.R +++ b/R/utils_data_handling.R @@ -65,12 +65,14 @@ merge_pred_and_obs <- function(forecasts, observations, basenames_y <- sub(".y$", "", colnames_y) # see whether the column name as well as the content is the same - overlapping <- (as.list(combined[, ..colnames_x]) %in% as.list(combined[, ..colnames_y])) & basenames_x == basenames_y + overlapping <- ( + as.list(combined[, ..colnames_x]) %in% as.list(combined[, ..colnames_y]) + ) & (basenames_x == basenames_y) overlap_names <- colnames_x[overlapping] basenames_overlap <- sub(".x$", "", overlap_names) # delete overlapping columns - if (length(basenames_overlap > 0)) { + if (length(basenames_overlap) > 0) { combined[, paste0(basenames_overlap, ".x") := NULL] combined[, paste0(basenames_overlap, ".y") := NULL] } diff --git a/man/example_binary.Rd b/man/example_binary.Rd index 47797b8cd..6977f7cf0 100644 --- a/man/example_binary.Rd +++ b/man/example_binary.Rd @@ -19,7 +19,9 @@ A data frame with 346 rows and 10 columns: } } \source{ -\url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +\url{https://github.com/covid19-forecast-hub-europe/ +covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +} } \usage{ example_binary diff --git a/man/example_continuous.Rd b/man/example_continuous.Rd index 354ebc5d6..d78e66656 100644 --- a/man/example_continuous.Rd +++ b/man/example_continuous.Rd @@ -20,7 +20,9 @@ A data frame with 13,429 rows and 10 columns: } } \source{ -\url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +\url{https://github.com/covid19-forecast-hub-europe/ +covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +} } \usage{ example_continuous diff --git a/man/example_integer.Rd b/man/example_integer.Rd index ebdc643af..192edcc33 100644 --- a/man/example_integer.Rd +++ b/man/example_integer.Rd @@ -18,6 +18,9 @@ A data frame with 13,429 rows and 10 columns: \item{predicted}{predicted value} \item{sample_id}{id for the corresponding sample} } +#' @source \url{https://github.com/covid19-forecast-hub-europe/ +covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +} } \usage{ example_integer diff --git a/man/example_point.Rd b/man/example_point.Rd index 1eb734b76..23bbf3d9d 100644 --- a/man/example_point.Rd +++ b/man/example_point.Rd @@ -19,7 +19,9 @@ A data frame with } } \source{ -\url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +\url{https://github.com/covid19-forecast-hub-europe/ +covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +} } \usage{ example_point diff --git a/man/example_quantile.Rd b/man/example_quantile.Rd index 2582907e9..59c2f3e13 100644 --- a/man/example_quantile.Rd +++ b/man/example_quantile.Rd @@ -20,7 +20,9 @@ A data frame with } } \source{ -\url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +\url{https://github.com/covid19-forecast-hub-europe/ +covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +} } \usage{ example_quantile diff --git a/man/example_quantile_forecasts_only.Rd b/man/example_quantile_forecasts_only.Rd index d789ed1e0..95875fc68 100644 --- a/man/example_quantile_forecasts_only.Rd +++ b/man/example_quantile_forecasts_only.Rd @@ -18,7 +18,9 @@ A data frame with 7,581 rows and 9 columns: } } \source{ -\url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +\url{https://github.com/covid19-forecast-hub-europe/ +covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +} } \usage{ example_quantile_forecasts_only diff --git a/man/example_truth_only.Rd b/man/example_truth_only.Rd index f8ae05afa..080710450 100644 --- a/man/example_truth_only.Rd +++ b/man/example_truth_only.Rd @@ -15,7 +15,9 @@ A data frame with 140 rows and 5 columns: } } \source{ -\url{https://github.com/covid19-forecast-hub-europe/covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/} +\url{https://github.com/covid19-forecast-hub-europe/ +covid19-forecast-hub-europe/commit/a42867b1ea152c57e25b04f9faa26cfd4bfd8fa6/ +} } \usage{ example_truth_only diff --git a/man/metrics_quantile.Rd b/man/metrics_quantile.Rd index ea444ee7e..80137c0e5 100644 --- a/man/metrics_quantile.Rd +++ b/man/metrics_quantile.Rd @@ -13,13 +13,15 @@ metrics_quantile \description{ A named list with functions: \itemize{ -\item "wis" = \code{\link[=wis]{wis()}} +\item "wis" = \link{wis} \item "overprediction" = \code{\link[=overprediction]{overprediction()}} \item "underprediction" = \code{\link[=underprediction]{underprediction()}} \item "dispersion" = \code{\link[=dispersion]{dispersion()}} \item "bias" = \code{\link[=bias_quantile]{bias_quantile()}} -\item "coverage_50" = \(...) {run_safely(..., range = 50, fun = \link[=interval_coverage_quantile]{interval_coverage_quantile})} -\item "coverage_90" = \(...) {run_safely(..., range = 90, fun = \link[=interval_coverage_quantile]{interval_coverage_quantile})} +\item "coverage_50" = \code{\link[=interval_coverage_quantile]{interval_coverage_quantile()}} +\item "coverage_90" = \(...) \{ +run_safely(..., range = 90, fun = \link{interval_coverage_quantile}) +\} \item "coverage_deviation" = \code{\link[=interval_coverage_deviation_quantile]{interval_coverage_deviation_quantile()}}, \item "ae_median" = \code{\link[=ae_median_quantile]{ae_median_quantile()}} } diff --git a/vignettes/metric-details.Rmd b/vignettes/metric-details.Rmd index 300a501fc..c2e0fab95 100644 --- a/vignettes/metric-details.Rmd +++ b/vignettes/metric-details.Rmd @@ -64,7 +64,7 @@ data[, 1:6] %>% ```{r, echo = FALSE, results = "asis"} data <- readRDS( system.file( - "metrics-overview", "metrics-detailed.rds", + "metrics-overview", "metrics-detailed.rds", package = "scoringutils" ) ) diff --git a/vignettes/scoringutils.Rmd b/vignettes/scoringutils.Rmd index 4ae09b2ac..4a4ce5d43 100644 --- a/vignettes/scoringutils.Rmd +++ b/vignettes/scoringutils.Rmd @@ -35,7 +35,7 @@ Most of the time, the `score()` function will be able to do the entire evaluatio ```{r, echo=FALSE} requirements <- data.table( - "Format" = c( + Format = c( "quantile-based", "sample-based", "binary", "pairwise-comparisons" ), `Required columns` = c(