Skip to content

Commit

Permalink
version 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil authored and cran-robot committed Dec 3, 2020
1 parent 868875b commit fef52ae
Show file tree
Hide file tree
Showing 15 changed files with 224 additions and 328 deletions.
13 changes: 8 additions & 5 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: pairwiseComparisons
Title: Multiple Pairwise Comparison Tests
Version: 3.1.0
Version: 3.1.1
Authors@R:
person(given = "Indrajeet",
family = "Patil",
Expand All @@ -21,16 +21,19 @@ URL: https://indrajeetpatil.github.io/pairwiseComparisons/,
https://github.com/IndrajeetPatil/pairwiseComparisons
BugReports: https://github.com/IndrajeetPatil/pairwiseComparisons/issues
Depends: R (>= 3.6.0)
Imports: BayesFactor, dplyr, insight (>= 0.10.0), ipmisc (>= 4.1.0),
PMCMRplus, parameters, purrr, rlang, stats, WRS2
Imports: BayesFactor, dplyr, ipmisc, parameters (>= 0.10.0), PMCMRplus
(>= 1.7.1), purrr, rlang, stats, WRS2
Suggests: knitr, rmarkdown, spelling, testthat
Encoding: UTF-8
Language: en-US
LazyData: true
RoxygenNote: 7.1.1
Config/testthat/edition: 3
Config/testthat/parallel: true
Config/testthat/start-first: watcher, parallel*
NeedsCompilation: no
Packaged: 2020-10-28 16:01:35 UTC; inp099
Packaged: 2020-12-03 10:42:57 UTC; inp099
Author: Indrajeet Patil [cre, aut, cph]
(<https://orcid.org/0000-0003-1995-6531>, @patilindrajeets)
Repository: CRAN
Date/Publication: 2020-10-28 21:40:07 UTC
Date/Publication: 2020-12-03 13:10:02 UTC
28 changes: 14 additions & 14 deletions MD5
@@ -1,33 +1,33 @@
a80b43db255edb9696db72367adc4197 *DESCRIPTION
b7523a4d56f260682f657b326dee562b *DESCRIPTION
882a34304fbad2094a2e16309dd9884b *LICENSE
83dc6a06496388898152343fe7e65b7b *NAMESPACE
0a64b2368bc4a0104f3b43288c051ec6 *NEWS.md
d01c3925d5ddad42ca8384af4d952934 *NAMESPACE
a1163686402776cadcf129db23c6ee3a *NEWS.md
ed4748c9ff53303f377e6e98edb322c0 *R/data.R
d2fe0760e69c44e71090edbaae7fd5d8 *R/global_vars.R
9e94141f213503d677ccd7549dfa3765 *R/helpers.R
5682b69a42635a23afa66b5114377f40 *R/pairwise_comparisons.R
8c059bae5d217b3973d025e43b3a9d22 *R/reexports.R
5bd1bf4c99bd015312e845bd7aa6e638 *README.md
9a29bbadc219c24b95b03dc3cd1b2ba3 *R/global_vars.R
8883101818c9d68263cf1fd0440e96ae *R/helpers.R
c02951dc3c29414e99811cfab171c4fc *R/pairwise_comparisons.R
9d3bb59d8086f258a0417f92645dfe83 *R/reexports.R
760fd6aa91fa90748ba33d1fca0211a2 *README.md
60e0e78acc2c42531f52352f480329c2 *data/bugs_long.rdata
c5ee4fa2f5ea32bdf87e02ea71a415f8 *data/iris_long.rdata
91069babfae39db7b08f35ede31084f2 *data/movies_long.rdata
54a342a94ac6e4232913e999a95d4e94 *data/movies_wide.rdata
2664a73ea8c7701c767239b0613dc913 *inst/CITATION
ea19f918d9a9b69dc86fa200b709e856 *inst/WORDLIST
47a20c5943dc882c5aa35c0c37e0b130 *inst/WORDLIST
802fc4c2df4afaaf8de39a8b423f5a7b *man/bugs_long.Rd
cdd673e67a6eb0665f2810f11ecc3e97 *man/figures/README-ggsignif-1.png
734551817a14e501488fefcdfe5cc798 *man/figures/README-ggsignif-1.png
fee4de0c3a90e593231760a3236aa44a *man/figures/README-ggsignif2-1.png
8aa93283e08db18090dc39423bd9b612 *man/figures/logo.png
253003637707cb3641bb791336692759 *man/iris_long.Rd
6e4d56978f52276057b7b86e9eac5033 *man/movies_long.Rd
0ebeb6520377257ca07f34ee5d266bbc *man/movies_wide.Rd
976ce17abcc524c608d6ea80b9d272e1 *man/p_adjust_text.Rd
7f7a1340e8dc84311cdd4405cae5b169 *man/pairwise_caption.Rd
1dca7c5f544d8a1726886d3a1d7fcab8 *man/pairwise_comparisons.Rd
138bdb68b99668f0280256e155f42437 *man/reexports.Rd
6ce41c2c41a482dfd6bb4e4ec0a51085 *man/pairwise_comparisons.Rd
25a47783641bee60b059593ce32cbe44 *man/reexports.Rd
4393414902910ca83ac7faf83be60afb *tests/README.md
dbd9bab057163c01c320d0b9d3bb9620 *tests/spelling.R
ac503b90bd70b6f265dc58b04d55fec1 *tests/testthat.R
b4600bff9ebb72c2aa12385dfa17f746 *tests/testthat/test-pairwise_caption_helpers.R
73e847f52e6098e5313893ce4b2a909e *tests/testthat/test-pairwise_comparisons_between.R
2ee60f3d1481f35ec3d604057b725b1f *tests/testthat/test-pairwise_comparisons_within.R
2a0a3c290119e35a4341bc4949151002 *tests/testthat/test-pairwise_comparisons_between.R
684ced6cea3b38be17fc3f81b62f0599 *tests/testthat/test-pairwise_comparisons_within.R
12 changes: 2 additions & 10 deletions NAMESPACE
@@ -1,12 +1,8 @@
# Generated by roxygen2: do not edit by hand

export("%$%")
export("%<-%")
export("%<>%")
export("%>%")
export("%|%")
export("%||%")
export(":=")
export(as_tibble)
export(p_adjust_text)
export(pairwise_caption)
Expand All @@ -16,6 +12,7 @@ importFrom(BayesFactor,ttestBF)
importFrom(PMCMRplus,durbinAllPairsTest)
importFrom(PMCMRplus,gamesHowellTest)
importFrom(PMCMRplus,kwAllPairsDunnTest)
importFrom(PMCMRplus,toTidy)
importFrom(WRS2,lincon)
importFrom(WRS2,rmmcp)
importFrom(dplyr,across)
Expand All @@ -30,25 +27,20 @@ importFrom(dplyr,rowwise)
importFrom(dplyr,select)
importFrom(dplyr,starts_with)
importFrom(dplyr,ungroup)
importFrom(insight,standardize_names)
importFrom(ipmisc,"%$%")
importFrom(ipmisc,"%<-%")
importFrom(ipmisc,"%<>%")
importFrom(ipmisc,"%>%")
importFrom(ipmisc,as_tibble)
importFrom(ipmisc,long_to_wide_converter)
importFrom(ipmisc,signif_column)
importFrom(ipmisc,specify_decimal_p)
importFrom(ipmisc,stats_type_switch)
importFrom(ipmisc,tibble)
importFrom(parameters,model_parameters)
importFrom(parameters,standardize_names)
importFrom(purrr,map2)
importFrom(purrr,map_dfr)
importFrom(rlang,"!!!")
importFrom(rlang,"!!")
importFrom(rlang,"%|%")
importFrom(rlang,"%||%")
importFrom(rlang,":=")
importFrom(rlang,as_string)
importFrom(rlang,enquo)
importFrom(rlang,ensym)
Expand Down
21 changes: 15 additions & 6 deletions NEWS.md
@@ -1,8 +1,15 @@
# pairwiseComparisons 3.1.1

- Minor internal refactoring.

- Removes the unnecessary (and confusing) `significance` column from all
outputs.

# pairwiseComparisons 3.1.0

- To be consistent with the rest of the `ggstatsverse`, the Bayes Factor
results are now always shown in favor of null over alternative (`BF01`).

- `pairwise_comparisons` function gets `subject.id` argument relevant for
repeated measures design.

Expand All @@ -13,7 +20,7 @@

- `pairwise_caption` function has changed its output to reflect changes made
to the *p*-value labels.

- Major internal refactoring to get rid of the following dependencies:
`broomExtra`, `dunn.test`, `forcats`, and `tidyr`. This comes at the cost of
omission of few of the details that were previously included in the output
Expand All @@ -27,7 +34,7 @@

- Fixes a bug which affected results for within-subjects design when the
dataframe wasn't sorted by `x` (#19).

- This fix also now makes the results more consistent, such that irrespective
of which type of statistics is chosen the `group1` and `group2` columns are
in identical order.
Expand All @@ -47,13 +54,13 @@

- Removes dependence on `jmv` and instead relies on `dunn.test` and
`PMCMRplus`. This significantly reduces number of dependencies.

- The non-parametric Dwass test has been changed to Dunn test.

# pairwiseComparisons 0.3.1

- Adapts to breaking changes in upcoming release of `broom 0.7.0`.

- Thanks to Sarah, the package has a hexsticker. :)

# pairwiseComparisons 0.3.0
Expand Down Expand Up @@ -81,6 +88,7 @@
function now instead adds two columns (`test.details` and
`p.value.adjustment`) to all outputs specifying which test was carried out
and which adjustment method is being used for *p*-value correction.

- Gets rid of `groupedstats` and `crayon` from dependencies.

# pairwiseComparisons 0.1.2
Expand All @@ -93,10 +101,11 @@
- The `p.value.label` in the output dataframe has been renamed to `label` to
consider the possibility that Bayes Factor tests might also be supported in
future.

- The label now specified whether the *p*-value was adjusted or not for
multiple comparisons.

# pairwiseComparisons 0.1.0

- First release of the package.

1 change: 0 additions & 1 deletion R/global_vars.R
Expand Up @@ -11,7 +11,6 @@ utils::globalVariables(
"group1",
"group2",
"log_e_bf10",
"p.crit",
"p.value",
"psihat"
),
Expand Down
45 changes: 10 additions & 35 deletions R/helpers.R
@@ -1,41 +1,20 @@
#' @name PMCMR_to_tibble
#' @note Adapted from `dfrtopics::gather_matrix()`.
#'
#' @importFrom stats na.omit
#' @importFrom dplyr bind_cols contains select
#' @importFrom dplyr contains select rename
#' @importFrom PMCMRplus toTidy
#'
#' @keywords internal
#' @noRd

# function body
PMCMR_to_tibble <- function(mod, ...) {
# combining statistic and p-value columns
dplyr::bind_cols(
matrix_to_tidy(mod$statistic, "statistic"),
dplyr::select(matrix_to_tidy(mod$p.value, "p.value"), -dplyr::contains("group"))
)
}

#' @keywords internal
#' @noRd

matrix_to_tidy <- function(m, col_name = "value", ...) {
result <-
data.frame(
group2 = rep(rownames(m), each = ncol(m)),
group1 = rep(colnames(m), times = nrow(m)),
value = as.numeric(base::t(m)),
stringsAsFactors = FALSE
)

names(result)[3] <- col_name
as_tibble(stats::na.omit(result))
dplyr::select(PMCMRplus::toTidy(mod), -dplyr::contains("method")) %>%
dplyr::rename(group2 = group1, group1 = group2)
}

#' @importFrom BayesFactor ttestBF
#' @importFrom dplyr mutate
#' @importFrom parameters model_parameters
#' @importFrom insight standardize_names
#' @importFrom parameters model_parameters standardize_names
#' @importFrom rlang exec new_formula !!!
#'
#' @noRd
Expand All @@ -47,9 +26,6 @@ bf_internal_ttest <- function(data,
paired = FALSE,
bf.prior = 0.707,
...) {
# make sure both quoted and unquoted arguments are allowed
c(x, y) %<-% c(rlang::ensym(x), rlang::ensym(y))

# have a proper cleanup with NA removal
data %<>%
ipmisc::long_to_wide_converter(
Expand All @@ -62,24 +38,23 @@ bf_internal_ttest <- function(data,

# relevant arguments
if (isTRUE(paired)) bf.args <- list(x = data[[2]], y = data[[3]])
if (isFALSE(paired)) bf.args <- list(formula = rlang::new_formula({{ y }}, {{ x }}))
if (isFALSE(paired)) bf.args <- list(formula = rlang::new_formula(y, x))

# creating a BayesFactor object
bf_object <-
rlang::exec(
.fn = BayesFactor::ttestBF,
rscale = bf.prior,
paired = paired,
progress = FALSE,
data = as.data.frame(data),
!!!bf.args
)

# extracting Bayes Factors and other details
parameters::model_parameters(bf_object, ...) %>%
insight::standardize_names(data = ., style = "broom") %>%
dplyr::rename(.data = ., "bf10" = "bayes.factor") %>%
dplyr::mutate(.data = ., log_e_bf10 = log(bf10))
parameters::model_parameters(bf_object, verbose = FALSE, ...) %>%
parameters::standardize_names(data = ., style = "broom") %>%
dplyr::rename("bf10" = "bayes.factor") %>%
dplyr::mutate(log_e_bf10 = log(bf10))
}


Expand Down

0 comments on commit fef52ae

Please sign in to comment.