Skip to content

Commit

Permalink
version 3.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil authored and cran-robot committed Jun 1, 2021
1 parent 1fb3ac1 commit 0157227
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 70 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: pairwiseComparisons
Title: Multiple Pairwise Comparison Tests
Version: 3.1.5
Version: 3.1.6
Authors@R:
person(given = "Indrajeet",
family = "Patil",
Expand All @@ -21,8 +21,8 @@ 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.13.2), ipmisc, parameters
(>= 0.13.0), PMCMRplus, purrr, rlang, stats, WRS2
Imports: BayesFactor, dplyr, insight (>= 0.14.1), ipmisc, parameters
(>= 0.14.0), PMCMRplus, purrr, rlang, stats, WRS2 (>= 1.1-1)
Suggests: knitr, rmarkdown, spelling, testthat
Encoding: UTF-8
Language: en-US
Expand All @@ -31,8 +31,8 @@ RoxygenNote: 7.1.1.9001
Config/testthat/edition: 3
Config/testthat/parallel: true
NeedsCompilation: no
Packaged: 2021-04-27 19:56:55 UTC; patil
Packaged: 2021-06-01 18:59:05 UTC; patil
Author: Indrajeet Patil [cre, aut, cph]
(<https://orcid.org/0000-0003-1995-6531>, @patilindrajeets)
Repository: CRAN
Date/Publication: 2021-04-27 20:30:02 UTC
Date/Publication: 2021-06-01 19:30:02 UTC
12 changes: 6 additions & 6 deletions MD5
@@ -1,13 +1,13 @@
6a18e352d9e7cd948be120c5cad8a9b5 *DESCRIPTION
79e44abfb2179979e1b4b9e6e827a1cc *DESCRIPTION
13126da2bad169ecfe01da3858042b62 *LICENSE
8f3ff8616f27753eb2f99de2c22651ab *NAMESPACE
37a507b4b641be4609ef013b05934f6b *NEWS.md
0efaf046cc2d88b23969e52ecef3bf14 *NEWS.md
e159c89f70bd1346ac96d934fead7650 *R/data.R
fc2a6efd2abe22c37d72745bceb27e15 *R/global_vars.R
cbca5e474f8e9f71c4387ecee5542233 *R/helpers.R
5d0f5f1753a9fdef3e5928f01b0e4174 *R/pairwise_comparisons.R
a3fa937dc9ef5f179189a3a8f15a2080 *R/helpers.R
27333a9d7a6747963cf3599e91c0db4b *R/pairwise_comparisons.R
3466adb4e21bde4a3b8e0ec9a4a6e609 *R/reexports.R
6f21915363252df9f3da79c06a68fd0f *README.md
5be0d56401e45a5e015cbfdcc1443521 *README.md
60e0e78acc2c42531f52352f480329c2 *data/bugs_long.rdata
91069babfae39db7b08f35ede31084f2 *data/movies_long.rdata
54a342a94ac6e4232913e999a95d4e94 *data/movies_wide.rdata
Expand All @@ -29,7 +29,7 @@ c3978703d8f40f2679795335715e98f4 *man/figures/lifecycle-experimental.svg
6255c1a466c7dc9cd2a52692be34bf93 *man/movies_wide.Rd
13938dce6baedd253f81a8f4ffaeca07 *man/p_adjust_text.Rd
69a3280df6dc95060c245b44708be994 *man/pairwise_caption.Rd
18fdfbe07ac9b33f1692c37eddc4b844 *man/pairwise_comparisons.Rd
d8aedfbcd16a34f2ea51bda525c9a0d6 *man/pairwise_comparisons.Rd
ccd436efc6a3de78bac2165798cf3b8e *man/reexports.Rd
50f330eeca8db092d6807e04457bd06d *tests/spelling.R
27ea038f6a1f6b418b4fecf225d1693e *tests/testthat.R
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
@@ -1,3 +1,9 @@
# pairwiseComparisons 3.1.6

- Maintenance and internal changes.

- Improvements to docs.

# pairwiseComparisons 3.1.5

- To avoid confusion among users, the trimming level for all functions is now
Expand Down
18 changes: 8 additions & 10 deletions R/helpers.R
Expand Up @@ -3,7 +3,7 @@

tidy_model_parameters <- function(model, ...) {
parameters::model_parameters(model, verbose = FALSE, ...) %>%
parameters::standardize_names(data = ., style = "broom")
parameters::standardize_names(style = "broom")
}

#' @importFrom BayesFactor ttestBF
Expand All @@ -18,7 +18,6 @@ bf_ttest <- function(data, x, y, paired = FALSE, bf.prior = 0.707, ...) {
# have a proper cleanup with NA removal
data %<>%
ipmisc::long_to_wide_converter(
data = .,
x = {{ x }},
y = {{ y }},
paired = paired,
Expand All @@ -30,14 +29,13 @@ bf_ttest <- function(data, x, y, paired = FALSE, bf.prior = 0.707, ...) {
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,
data = as.data.frame(data),
!!!bf.args
)
bf_object <- rlang::exec(
.fn = BayesFactor::ttestBF,
rscale = bf.prior,
paired = paired,
data = as.data.frame(data),
!!!bf.args
)

# extracting Bayes Factors and other details
dplyr::filter(tidy_model_parameters(bf_object), !is.na(bayes.factor)) %>%
Expand Down
76 changes: 39 additions & 37 deletions R/pairwise_comparisons.R
Expand Up @@ -24,10 +24,15 @@
#' `FALSE`.
#' @param k Number of digits after decimal point (should be an integer)
#' (Default: `k = 2L`).
#' @param bf.prior A number between `0.5` and `2` (default `0.707`), the prior
#' width to use in calculating Bayes factors and posterior estimates. In
#' addition to numeric arguments, several named values are also recognized:
#' `"medium"`, `"wide"`, and `"ultrawide"`, corresponding to *r* scale values
#' of 1/2, sqrt(2)/2, and 1, respectively. In case of an ANOVA, this value
#' corresponds to scale for fixed effects.
#' @param ... Additional arguments passed to other methods.
#' @inheritParams stats::t.test
#' @inheritParams WRS2::rmmcp
#' @inheritParams tidyBF::bf_ttest
#'
#' @return A tibble dataframe containing two columns corresponding to group
#' levels being compared with each other (`group1` and `group2`) and `p.value`
Expand Down Expand Up @@ -234,23 +239,22 @@ pairwise_comparisons <- function(data,

# running the appropriate test
if (type != "robust") {
df <-
suppressWarnings(rlang::exec(
.fn = .f,
# Dunn, Games-Howell, Student test
x = y_vec,
g = x_vec,
# Durbin-Conover test
groups = x_vec,
blocks = g_vec,
# Student
paired = paired,
# common
na.action = na.omit,
p.adjust.method = "none",
# problematic for other methods
!!!.f.args
)) %>%
df <- suppressWarnings(rlang::exec(
.fn = .f,
# Dunn, Games-Howell, Student test
x = y_vec,
g = x_vec,
# Durbin-Conover test
groups = x_vec,
blocks = g_vec,
# Student
paired = paired,
# common
na.action = na.omit,
p.adjust.method = "none",
# problematic for other methods
!!!.f.args
)) %>%
tidy_model_parameters(.) %>%
dplyr::rename(group2 = group1, group1 = group2)
}
Expand All @@ -268,8 +272,7 @@ pairwise_comparisons <- function(data,
}

# cleaning the raw object and getting it in the right format
df <-
eval(rlang::call2(.ns = .ns, .fn = .fn, tr = tr, !!!.f.args)) %>%
df <- eval(rlang::call2(.ns = .ns, .fn = .fn, tr = tr, !!!.f.args)) %>%
tidy_model_parameters(.)

# test details
Expand All @@ -280,23 +283,22 @@ pairwise_comparisons <- function(data,

if (type == "bayes") {
# combining results into a single dataframe and returning it
df_tidy <-
purrr::map_dfr(
# creating a list of dataframes with subsections of data
.x = purrr::map2(
.x = as.character(df$group1),
.y = as.character(df$group2),
.f = function(a, b) droplevels(dplyr::filter(df_int, {{ x }} %in% c(a, b)))
),
# internal function to carry out BF t-test
.f = ~ bf_ttest(
data = .x,
x = {{ x }},
y = {{ y }},
paired = paired,
bf.prior = bf.prior
)
) %>%
df_tidy <- purrr::map_dfr(
# creating a list of dataframes with subsections of data
.x = purrr::map2(
.x = as.character(df$group1),
.y = as.character(df$group2),
.f = function(a, b) droplevels(dplyr::filter(df_int, {{ x }} %in% c(a, b)))
),
# internal function to carry out BF t-test
.f = ~ bf_ttest(
data = .x,
x = {{ x }},
y = {{ y }},
paired = paired,
bf.prior = bf.prior
)
) %>%
dplyr::rowwise() %>%
dplyr::mutate(label = paste0("list(~log[e](BF['01'])==", format_value(-log_e_bf10, k), ")")) %>%
dplyr::ungroup() %>%
Expand Down
21 changes: 13 additions & 8 deletions README.md
Expand Up @@ -3,14 +3,19 @@

# `pairwiseComparisons`: Multiple Pairwise Comparison Tests

| Package | Status | Usage | GitHub | References |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![CRAN\_Release\_Badge](http://www.r-pkg.org/badges/version-ago/pairwiseComparisons)](https://CRAN.R-project.org/package=pairwiseComparisons) | [![Travis Build Status](https://travis-ci.org/IndrajeetPatil/pairwiseComparisons.svg?branch=master)](https://travis-ci.org/IndrajeetPatil/pairwiseComparisons) | [![Daily downloads badge](https://cranlogs.r-pkg.org/badges/last-day/pairwiseComparisons?color=blue)](https://CRAN.R-project.org/package=pairwiseComparisons) | [![GitHub version](https://img.shields.io/badge/GitHub-3.1.5-orange.svg?style=flat-square)](https://github.com/IndrajeetPatil/pairwiseComparisons/) | [![Website](https://img.shields.io/badge/website-pairwiseComparisons-orange.svg?colorB=E91E63)](https://indrajeetpatil.github.io/pairwiseComparisons/) |
| [![CRAN Checks](https://cranchecks.info/badges/summary/pairwiseComparisons)](https://cran.r-project.org/web/checks/check_results_pairwiseComparisons.html) | [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/IndrajeetPatil/pairwiseComparisons?branch=master&svg=true)](https://ci.appveyor.com/project/IndrajeetPatil/pairwiseComparisons) | [![Weekly downloads badge](https://cranlogs.r-pkg.org/badges/last-week/pairwiseComparisons?color=blue)](https://CRAN.R-project.org/package=pairwiseComparisons) | [![Forks](https://img.shields.io/badge/forks-5-blue.svg)](https://github.com/IndrajeetPatil/pairwiseComparisons/) | [![Rdoc](https://www.rdocumentation.org/badges/version/pairwiseComparisons)](https://www.rdocumentation.org/packages/pairwiseComparisons) |
| [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.6.0-6666ff.svg)](https://cran.r-project.org/) | [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html) | [![Monthly downloads badge](https://cranlogs.r-pkg.org/badges/last-month/pairwiseComparisons?color=blue)](https://CRAN.R-project.org/package=pairwiseComparisons) | [![Github Issues](https://img.shields.io/badge/issues-1-red.svg)](https://github.com/IndrajeetPatil/pairwiseComparisons/issues) | [![vignettes](https://img.shields.io/badge/vignettes-3.1.0-orange.svg?colorB=FF5722)](https://github.com/IndrajeetPatil/pairwiseComparisons/blob/master/README.md) |
| [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/IndrajeetPatil/pairwiseComparisons.svg)](https://github.com/IndrajeetPatil/pairwiseComparisons) | [![Coverage Status](https://coveralls.io/repos/github/IndrajeetPatil/pairwiseComparisons/badge.svg?branch=master)](https://coveralls.io/github/IndrajeetPatil/pairwiseComparisons?branch=master) | [![Total downloads badge](https://cranlogs.r-pkg.org/badges/grand-total/pairwiseComparisons?color=blue)](https://CRAN.R-project.org/package=pairwiseComparisons) | [![Github Stars](https://img.shields.io/github/stars/IndrajeetPatil/pairwiseComparisons.svg?style=social&label=Github)](https://github.com/IndrajeetPatil/pairwiseComparisons) | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2074621.svg)](https://doi.org/10.5281/zenodo.2074621) |
| [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) | [![Codecov test coverage](https://codecov.io/gh/IndrajeetPatil/pairwiseComparisons/branch/master/graph/badge.svg)](https://codecov.io/gh/IndrajeetPatil/pairwiseComparisons?branch=master) | [![pkgdown](https://github.com/IndrajeetPatil/pairwiseComparisons/workflows/pkgdown/badge.svg)](https://github.com/IndrajeetPatil/pairwiseComparisons/actions) | [![Last-changedate](https://img.shields.io/badge/last%20change-2021--04--27-yellowgreen.svg)](https://github.com/IndrajeetPatil/pairwiseComparisons/commits/master) | [![GitHub last commit](https://img.shields.io/github/last-commit/IndrajeetPatil/pairwiseComparisons.svg)](https://github.com/IndrajeetPatil/pairwiseComparisons/commits/master) |
| [![status](https://tinyverse.netlify.com/badge/pairwiseComparisons)](https://CRAN.R-project.org/package=pairwiseComparisons) | [![R build status](https://github.com/IndrajeetPatil/pairwiseComparisons/workflows/R-CMD-check/badge.svg)](https://github.com/IndrajeetPatil/pairwiseComparisons) | [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/pairwiseComparisons/community) | [![Project Status](http://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/IndrajeetPatil/pairwiseComparisons/issues) |
[![CRAN\_Release\_Badge](https://www.r-pkg.org/badges/version-ago/pairwiseComparisons)](https://CRAN.R-project.org/package=pairwiseComparisons)
[![CRAN
Checks](https://cranchecks.info/badges/summary/pairwiseComparisons)](https://cran.r-project.org/web/checks/check_results_pairwiseComparisons.html)
[![Travis Build
Status](https://travis-ci.org/IndrajeetPatil/pairwiseComparisons.svg?branch=master)](https://travis-ci.org/IndrajeetPatil/pairwiseComparisons)
[![AppVeyor Build
Status](https://ci.appveyor.com/api/projects/status/github/IndrajeetPatil/pairwiseComparisons?branch=master&svg=true)](https://ci.appveyor.com/project/IndrajeetPatil/pairwiseComparisons)
[![pkgdown](https://github.com/IndrajeetPatil/pairwiseComparisons/workflows/pkgdown/badge.svg)](https://github.com/IndrajeetPatil/pairwiseComparisons/actions)
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![Daily downloads
badge](https://cranlogs.r-pkg.org/badges/last-day/pairwiseComparisons?color=blue)](https://CRAN.R-project.org/package=pairwiseComparisons)
[![Total downloads
badge](https://cranlogs.r-pkg.org/badges/grand-total/pairwiseComparisons?color=blue)](https://CRAN.R-project.org/package=pairwiseComparisons)

# Introduction <img src="man/figures/logo.png" align="right" width="240" />

Expand Down
20 changes: 16 additions & 4 deletions man/pairwise_comparisons.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0157227

Please sign in to comment.