From b55ea8d027c7892639ee8e9e456155a66608ec93 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 2 Dec 2021 11:53:36 +0100 Subject: [PATCH] narrow down spurious warnings opens #344 --- R/email.R | 23 +++++++++-------------- R/metrics_funder.R | 5 +++-- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/R/email.R b/R/email.R index 51f8016b..b9c41c91 100644 --- a/R/email.R +++ b/R/email.R @@ -142,20 +142,15 @@ block_text_centered_vec <- function(...) { mc_render_email <- function(dois = doi_examples$good[1:10], translator = mc_translator(), ...) { - # suppression is dangerous hack-fix for - # https://github.com/subugoe/metacheck/issues/138 - # otherwise, tests are illegibly noisy - suppressWarnings( - blastula::render_email( - input = path_report_rmd(lang = translator$get_translation_language()), - render_options = list( - params = list( - dois = dois, - translator = translator - ) - ), - ... - ) + blastula::render_email( + input = path_report_rmd(lang = translator$get_translation_language()), + render_options = list( + params = list( + dois = dois, + translator = translator + ) + ), + ... ) } diff --git a/R/metrics_funder.R b/R/metrics_funder.R index 88393f51..09cd8919 100644 --- a/R/metrics_funder.R +++ b/R/metrics_funder.R @@ -30,8 +30,9 @@ funder_metrics <- function(funder_info = NULL) { mutate(name = ifelse(is.na(.data$name), "No funding info", .data$name)) %>% mutate(name = forcats::fct_lump_prop(.data$name, prop = 0.03, other_level = "Other funders")) %>% mutate(name = forcats::fct_infreq(.data$name)) %>% - mutate(name = forcats::fct_relevel(.data$name, "Other funders", after = Inf)) %>% - mutate(name = forcats::fct_relevel(.data$name, "No funding info", after = Inf)) + # TODO hack fix to avoid spurious warnings https://github.com/subugoe/metacheck/issues/344 + suppressWarnings(mutate(name = forcats::fct_relevel(.data$name, "Other funders", after = Inf))) %>% + suppressWarnings(mutate(name = forcats::fct_relevel(.data$name, "No funding info", after = Inf))) } else { out <-funder_info %>% mutate(name = ifelse(is.na(.data$name), "No funding info", .data$name)) %>%