diff --git a/R/centrality_description.R b/R/centrality_description.R index 573a9b76..9dc9f553 100644 --- a/R/centrality_description.R +++ b/R/centrality_description.R @@ -36,14 +36,14 @@ centrality_description <- function(data, tr = 0.2, k = 2L, ...) { - type <- stats_type_switch(type) # styler: off - centrality <- case_when( - type == "parametric" ~ "mean", - type == "nonparametric" ~ "median", - type == "robust" ~ "trimmed", - type == "bayes" ~ "MAP" + centrality <- case_match( + stats_type_switch(type), + "parametric" ~ "mean", + "nonparametric" ~ "median", + "robust" ~ "trimmed", + "bayes" ~ "MAP" ) # styler: on diff --git a/R/pairwise_comparisons.R b/R/pairwise_comparisons.R index 74791b1d..bf6deb02 100644 --- a/R/pairwise_comparisons.R +++ b/R/pairwise_comparisons.R @@ -264,7 +264,7 @@ pairwise_comparisons <- function(data, mutate( expression = case_when( p.adjust.method == "None" ~ glue("list(italic(p)[unadj.]=='{format_value(p.value, k)}')"), - TRUE ~ glue("list(italic(p)['{p.adjust.method}'-adj.]=='{format_value(p.value, k)}')") + .default = glue("list(italic(p)['{p.adjust.method}'-adj.]=='{format_value(p.value, k)}')") ) ) } @@ -296,6 +296,6 @@ p_adjust_text <- function(p.adjust.method) { ), grepl("^BH|^f", p.adjust.method) ~ "FDR", grepl("^BY", p.adjust.method) ~ "BY", - TRUE ~ "Holm" + .default = "Holm" ) } diff --git a/R/tidy_model_expressions.R b/R/tidy_model_expressions.R index 391fac6d..8a637a5d 100644 --- a/R/tidy_model_expressions.R +++ b/R/tidy_model_expressions.R @@ -62,7 +62,7 @@ tidy_model_expressions <- function(data, df %<>% mutate( expression = case_when( df.error %in% c("NA", "Inf") ~ glue("list({es.text}=='{estimate}', italic(t)=='{statistic}', italic(p)=='{p.value}')"), - TRUE ~ glue("list({es.text}=='{estimate}', italic(t)('{df.error}')=='{statistic}', italic(p)=='{p.value}')") + .default = glue("list({es.text}=='{estimate}', italic(t)('{df.error}')=='{statistic}', italic(p)=='{p.value}')") ) ) } @@ -105,7 +105,7 @@ tidy_model_expressions <- function(data, ungroup() %>% # convert from `expression` to `language` mutate(expression = case_when( is.na(unlist(expression)) ~ list(NULL), - TRUE ~ unlist(expression) + .default = unlist(expression) )) %>% .add_package_class() }