From 70611d0cd770cdd1709befe696e3e1aecd7306d5 Mon Sep 17 00:00:00 2001 From: Florian Kohrt Date: Wed, 21 Aug 2024 01:38:38 +0200 Subject: [PATCH] Fix using a custom rule `ifelse()` is unsafe because it silently only returns the first element of `no` if `test` is of length 1. --- R/report_htest_ttest.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/report_htest_ttest.R b/R/report_htest_ttest.R index 0bd3dcc5..b4536322 100644 --- a/R/report_htest_ttest.R +++ b/R/report_htest_ttest.R @@ -48,7 +48,7 @@ table <- do.call(effectsize::effectsize, es_args) ci <- attributes(table)$ci estimate <- names(table)[1] - dot_args$rules <- ifelse(is.null(dot_args$rules), rules, dot_args$rules) + dot_args$rules <- if(is.null(dot_args$rules)) rules else dot_args$rules es_args <- c(list(table), dot_args) interpretation <- do.call(effectsize::interpret, es_args)$Interpretation