Skip to content

Commit

Permalink
removing the automatic option exact = FALSE used when method = "wilco…
Browse files Browse the repository at this point in the history
…x.test" #141
  • Loading branch information
kassambara committed Jun 3, 2019
1 parent 80f198b commit bd67fb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## Minor changes

- When method = "wilcox.test", the function `compare_means()` set automatically the option `exact = FALSE`. This is no longer the case ([@stemicha, #141](https://github.com/kassambara/ggpubr/issues/141).
- `stat_pvalue_manual()` now supports dodged grouped plots ([@emcnerny, #104](https://github.com/kassambara/ggpubr/issues/104).
- the argument `position` is now handled by `ggdotplot()` ([@Adam-JJJJJ, #178](https://github.com/kassambara/ggpubr/issues/178)

Expand Down
9 changes: 4 additions & 5 deletions R/compare_means.R
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,8 @@ compare_means <- function(formula, data, method = "wilcox.test",
if(.is_empty(group)) # Case of null model
test.opts <- list(x = .select_vec(data, x), ...)
else test.opts <- list(formula = formula, data = data, ...)
if(method == "wilcox.test") test.opts$exact <- FALSE

res <- data.frame(p = do.call(test, test.opts)$p.value)
res <- data.frame(p = suppressWarnings(do.call(test, test.opts)$p.value))
group1 <- group2 <- NULL

if(!.is_empty(group)){
Expand Down Expand Up @@ -327,15 +326,15 @@ compare_means <- function(formula, data, method = "wilcox.test",
g = .select_vec(data, group),
paired = paired,
...)
if(method == "pairwise.wilcox.test") test.opts$exact <- FALSE
else if(method == "pairwise.t.test"){
# if(method == "pairwise.wilcox.test") test.opts$exact <- FALSE
if(method == "pairwise.t.test"){
if(missing(pool.sd)){
if(!paired) pool.sd <- FALSE
}
test.opts$pool.sd <- pool.sd
}

pvalues <- do.call(test, test.opts)$p.value %>%
pvalues <- suppressWarnings(do.call(test, test.opts)$p.value) %>%
as.data.frame()
group1 <- group2 <- p <- NULL
pvalues$group2 <- rownames(pvalues)
Expand Down

0 comments on commit bd67fb7

Please sign in to comment.