From 9aa85d30683a7e33c21151089e52730692c3ed18 Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Sat, 18 Nov 2023 16:32:57 +0100 Subject: [PATCH 1/3] delete code remnants that shouldn't be there --- R/correlations.R | 2 -- tests/testthat/test-plot_correlation.R | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/R/correlations.R b/R/correlations.R index 75eda7583..0a553e8a7 100644 --- a/R/correlations.R +++ b/R/correlations.R @@ -21,8 +21,6 @@ correlation <- function(scores, metrics = NULL, digits = NULL) { - metrics <- check_metrics(metrics) - metrics <- get_metrics(scores) # if quantile column is present, throw a warning diff --git a/tests/testthat/test-plot_correlation.R b/tests/testthat/test-plot_correlation.R index be29faf3b..0b170b963 100644 --- a/tests/testthat/test-plot_correlation.R +++ b/tests/testthat/test-plot_correlation.R @@ -1,5 +1,5 @@ test_that("plot_correlation() works as expected", { - correlations <- correlation(summarise_scores(scores), digits = 2) + correlations <- correlation(summarise_scores(scores_quantile), digits = 2) p <- plot_correlation(correlations) expect_s3_class(p, "ggplot") skip_on_cran() From 32d8c2dd034ecbefd625fb469548f4a6939d336e Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Sun, 19 Nov 2023 17:43:23 +0100 Subject: [PATCH 2/3] Update gh action and DESCRIPTION to use R >= 3.6 --- .github/workflows/R-CMD-check.yaml | 2 +- DESCRIPTION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index f2a50448b..cda899829 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -23,7 +23,7 @@ jobs: - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - {os: ubuntu-latest, r: 'oldrel-1'} - - {os: ubuntu-latest, r: '3.5'} + - {os: ubuntu-latest, r: '3.6'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} diff --git a/DESCRIPTION b/DESCRIPTION index cde730e6e..95e581a07 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -73,5 +73,5 @@ URL: https://doi.org/10.48550/arXiv.2205.07090, https://epiforecasts.io/scoringu BugReports: https://github.com/epiforecasts/scoringutils/issues VignetteBuilder: knitr Depends: - R (>= 3.5) + R (>= 3.6) Roxygen: list(markdown = TRUE) From fbcf6f17ee1c5a4dd219f55e92f8e05205d37797 Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Mon, 20 Nov 2023 08:58:22 +0100 Subject: [PATCH 3/3] Replace |> with %>% in tests to prevent them from failing with R 3.6 --- tests/testthat/test-plot_interval_coverage.R | 2 +- tests/testthat/test-plot_quantile_coverage.R | 2 +- tests/testthat/test-plot_ranges.R | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-plot_interval_coverage.R b/tests/testthat/test-plot_interval_coverage.R index 0e885219f..5ff1fbf98 100644 --- a/tests/testthat/test-plot_interval_coverage.R +++ b/tests/testthat/test-plot_interval_coverage.R @@ -1,5 +1,5 @@ test_that("plot_interval_coverage() works as expected", { - coverage <- add_coverage(example_quantile) |> + coverage <- add_coverage(example_quantile) %>% summarise_scores(by = c("model", "range")) p <- plot_interval_coverage(coverage) expect_s3_class(p, "ggplot") diff --git a/tests/testthat/test-plot_quantile_coverage.R b/tests/testthat/test-plot_quantile_coverage.R index 060b9be26..1851ccb5c 100644 --- a/tests/testthat/test-plot_quantile_coverage.R +++ b/tests/testthat/test-plot_quantile_coverage.R @@ -1,5 +1,5 @@ test_that("plot_quantile_coverage() works as expected", { - coverage <- add_coverage(example_quantile) |> + coverage <- add_coverage(example_quantile) %>% summarise_scores(by = c("model", "quantile")) p <- plot_quantile_coverage(coverage) diff --git a/tests/testthat/test-plot_ranges.R b/tests/testthat/test-plot_ranges.R index b4dec124e..9a18cffe3 100644 --- a/tests/testthat/test-plot_ranges.R +++ b/tests/testthat/test-plot_ranges.R @@ -1,8 +1,8 @@ m <- modifyList(metrics_no_cov_no_ae, list("bias" = NULL)) sum_scores <- copy(example_quantile) %>% - .[, interval_range := scoringutils:::get_range_from_quantile(quantile)] |> - score(metrics = m) |> + .[, interval_range := scoringutils:::get_range_from_quantile(quantile)] %>% + score(metrics = m) %>% summarise_scores(by = c("model", "target_type", "interval_range")) sum_scores[, range := interval_range]