diff --git a/R/interpret_oddsratio.R b/R/interpret_oddsratio.R index fd878622..99bd0011 100644 --- a/R/interpret_oddsratio.R +++ b/R/interpret_oddsratio.R @@ -47,5 +47,5 @@ interpret_oddsratio <- function(OR, rules = "cohen1988", p0, log = FALSE, ...) { OR <- exp(OR) } - interpret(OR, rules, transform = function(.x) ifelse(.x < 1, 1/.x, .x)) + interpret(OR, rules, transform = function(.x) ifelse(.x < 1, 1 / .x, .x)) } diff --git a/R/rank_ANOVA.R b/R/rank_ANOVA.R index 6a58a6a6..f4ee4abb 100644 --- a/R/rank_ANOVA.R +++ b/R/rank_ANOVA.R @@ -280,9 +280,12 @@ kendalls_w <- function(x, groups, blocks, data = NULL, boot_fun <- function(.data, .i) { split(.data$x, .data$groups) <- - lapply(split(.data$x, .data$groups), + lapply( + split(.data$x, .data$groups), function(v) { - if (length(v) < 2L) return(v) + if (length(v) < 2L) { + return(v) + } sample(v, size = length(v), replace = TRUE) } ) diff --git a/tests/testthat/test-interpret.R b/tests/testthat/test-interpret.R index d8cd603a..a8f178f1 100644 --- a/tests/testthat/test-interpret.R +++ b/tests/testthat/test-interpret.R @@ -100,13 +100,15 @@ test_that("interpret_rope", { test_that("interpret_oddsratio", { # Chen 2010, table 1 row 6 - OR <- c(1.4, 2.5, 4.4, 7.5) + OR <- c(1.4, 2.5, 4.4, 7.5) p0 <- 0.06 expect_equal(interpret_oddsratio(OR, p0 = p0), c("very small", "small", "medium", "large"), ignore_attr = TRUE) expect_equal(interpret_oddsratio(OR), c("very small", "medium", "large", "large"), ignore_attr = TRUE) - expect_equal(interpret_oddsratio(c(0.1, 0.5, 2, 10), - rules(3, c("A", "B"))), c("B", "A", "A", "B"), ignore_attr = TRUE) + expect_equal(interpret_oddsratio( + c(0.1, 0.5, 2, 10), + rules(3, c("A", "B")) + ), c("B", "A", "A", "B"), ignore_attr = TRUE) })