Skip to content

Commit

Permalink
Fix using a custom rule
Browse files Browse the repository at this point in the history
`ifelse()` is unsafe because it silently only returns the first element of `no` if `test` is of length 1.
  • Loading branch information
fkohrt authored Aug 20, 2024
1 parent 69e8c5f commit 70611d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/report_htest_ttest.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 51 in R/report_htest_ttest.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/report_htest_ttest.R,line=51,col=23,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.

es_args <- c(list(table), dot_args)
interpretation <- do.call(effectsize::interpret, es_args)$Interpretation
Expand Down

0 comments on commit 70611d0

Please sign in to comment.