Skip to content

Commit

Permalink
narrow down spurious warnings
Browse files Browse the repository at this point in the history
opens #344
  • Loading branch information
maxheld83 committed Dec 2, 2021
1 parent 04856db commit b55ea8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
23 changes: 9 additions & 14 deletions R/email.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
),
...
)
}

Expand Down
5 changes: 3 additions & 2 deletions R/metrics_funder.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) %>%
Expand Down

0 comments on commit b55ea8d

Please sign in to comment.