From c121c87f15be97d6906b5ac99d9ad2010eb32124 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 12 Sep 2023 19:50:40 +0530 Subject: [PATCH 1/5] RC: CRAN 1.5.2 (#248) * update comment * bump Pandoc and update linters * bump versions * bump to devel * get rid of note about Rd cross-references * get rid of new lints * Update global_vars.R * update workflows * fixes warning in example? * revert correlation version bump * Apply automatic changes * just suppress warnings * fix lints * minor * Fix failures on R-devel closes #251 --------- Co-authored-by: IndrajeetPatil --- .github/workflows/R-CMD-check-devel.yaml | 4 +- .github/workflows/R-CMD-check-hard.yaml | 4 +- .github/workflows/R-CMD-check-strict.yaml | 4 +- .github/workflows/R-CMD-check.yaml | 4 +- .github/workflows/check-all-examples.yaml | 2 +- .github/workflows/check-link-rot.yaml | 4 +- .../workflows/check-random-test-order.yaml | 2 +- .github/workflows/check-readme.yaml | 4 +- .github/workflows/check-spelling.yaml | 4 +- .github/workflows/check-styling.yaml | 2 +- .github/workflows/check-test-warnings.yaml | 2 +- .../workflows/check-vignette-warnings.yaml | 4 +- .github/workflows/html-5-check.yaml | 2 +- .github/workflows/lint-changed-files.yaml | 33 +++++++++--- .github/workflows/lint.yaml | 16 ++++-- .github/workflows/pkgdown-no-suggests.yaml | 4 +- .github/workflows/pkgdown.yaml | 4 +- .github/workflows/pre-commit.yaml | 2 +- .github/workflows/styler.yaml | 2 +- .github/workflows/test-coverage-examples.yaml | 2 +- .github/workflows/test-coverage.yaml | 2 +- .lintr | 15 ++++-- CITATION.cff | 54 +++++++++++++++---- DESCRIPTION | 15 +++--- NEWS.md | 4 ++ R/add_expression_col.R | 6 +-- R/contingency_table.R | 4 +- R/global_vars.R | 3 +- R/helpers_easystats.R | 4 +- R/long_to_wide_converter.R | 26 +++------ R/meta_analysis.R | 51 +++++++----------- R/oneway_anova.R | 2 +- R/pairwise_comparisons.R | 1 + R/tidy_model_expressions.R | 8 +-- R/two_sample_test.R | 43 +++++++-------- codemeta.json | 30 +++++++---- cran-comments.md | 2 +- man/long_to_wide_converter.Rd | 22 ++------ man/meta_analysis.Rd | 43 ++++++--------- .../testthat/_snaps/long_to_wide_converter.md | 50 ++++++++++------- .../_snaps/one_two_sample_dataframes.md | 36 ++++++------- .../testthat/_snaps/two_sample_parametric.md | 30 +++++------ tests/testthat/test-meta_random_bayes.R | 4 +- tests/testthat/test-two_sample_robust.R | 4 +- 44 files changed, 301 insertions(+), 263 deletions(-) diff --git a/.github/workflows/R-CMD-check-devel.yaml b/.github/workflows/R-CMD-check-devel.yaml index 4cdc0fc5..c09a4a26 100644 --- a/.github/workflows/R-CMD-check-devel.yaml +++ b/.github/workflows/R-CMD-check-devel.yaml @@ -16,11 +16,11 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/R-CMD-check-hard.yaml b/.github/workflows/R-CMD-check-hard.yaml index 41bda7f1..65735bc0 100644 --- a/.github/workflows/R-CMD-check-hard.yaml +++ b/.github/workflows/R-CMD-check-hard.yaml @@ -23,11 +23,11 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/R-CMD-check-strict.yaml b/.github/workflows/R-CMD-check-strict.yaml index 15fd1728..7e4806ba 100644 --- a/.github/workflows/R-CMD-check-strict.yaml +++ b/.github/workflows/R-CMD-check-strict.yaml @@ -34,11 +34,11 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 8985b87c..f60b71a6 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -35,11 +35,11 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/check-all-examples.yaml b/.github/workflows/check-all-examples.yaml index fc83742a..7c8e9bd8 100644 --- a/.github/workflows/check-all-examples.yaml +++ b/.github/workflows/check-all-examples.yaml @@ -26,7 +26,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/check-link-rot.yaml b/.github/workflows/check-link-rot.yaml index e0eaf710..86758d2b 100644 --- a/.github/workflows/check-link-rot.yaml +++ b/.github/workflows/check-link-rot.yaml @@ -17,11 +17,11 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/check-random-test-order.yaml b/.github/workflows/check-random-test-order.yaml index 834391ce..5681cdff 100644 --- a/.github/workflows/check-random-test-order.yaml +++ b/.github/workflows/check-random-test-order.yaml @@ -14,7 +14,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/check-readme.yaml b/.github/workflows/check-readme.yaml index 89e6ab43..3aff87cf 100644 --- a/.github/workflows/check-readme.yaml +++ b/.github/workflows/check-readme.yaml @@ -26,11 +26,11 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/check-spelling.yaml b/.github/workflows/check-spelling.yaml index 8a67a614..7c7c7527 100644 --- a/.github/workflows/check-spelling.yaml +++ b/.github/workflows/check-spelling.yaml @@ -13,11 +13,11 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/check-styling.yaml b/.github/workflows/check-styling.yaml index c73b540e..c096ef4c 100644 --- a/.github/workflows/check-styling.yaml +++ b/.github/workflows/check-styling.yaml @@ -15,7 +15,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/check-test-warnings.yaml b/.github/workflows/check-test-warnings.yaml index 809aa31e..b5e86476 100644 --- a/.github/workflows/check-test-warnings.yaml +++ b/.github/workflows/check-test-warnings.yaml @@ -18,7 +18,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/check-vignette-warnings.yaml b/.github/workflows/check-vignette-warnings.yaml index 9d382b61..b7a3711f 100644 --- a/.github/workflows/check-vignette-warnings.yaml +++ b/.github/workflows/check-vignette-warnings.yaml @@ -18,11 +18,11 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/html-5-check.yaml b/.github/workflows/html-5-check.yaml index 09088a9e..8d72e82d 100644 --- a/.github/workflows/html-5-check.yaml +++ b/.github/workflows/html-5-check.yaml @@ -15,7 +15,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/lint-changed-files.yaml b/.github/workflows/lint-changed-files.yaml index 46c94135..d8b53464 100644 --- a/.github/workflows/lint-changed-files.yaml +++ b/.github/workflows/lint-changed-files.yaml @@ -12,7 +12,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -26,21 +26,40 @@ jobs: any::purrr needs: check - - name: Add lintr options - run: | - cat('\noptions(lintr.linter_file = ".lintr")\n', file = "~/.Rprofile", append = TRUE) - shell: Rscript {0} - - name: Install package run: R CMD INSTALL . - name: Extract and lint files changed by this PR run: | + options(crayon.enabled = TRUE) + library(lintr) files <- gh::gh("GET https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files") changed_files <- purrr::map_chr(files, "filename") all_files <- list.files(recursive = TRUE) exclusions_list <- as.list(setdiff(all_files, changed_files)) - lintr::lint_package(exclusions = exclusions_list) + lint_package(linters = linters_with_defaults( + absolute_path_linter = NULL, + assignment_linter = NULL, + commented_code_linter = NULL, + cyclocomp_linter(25L), + extraction_operator_linter = NULL, + implicit_integer_linter = NULL, + library_call_linter = NULL, + line_length_linter(120L), + namespace_linter = NULL, + nonportable_path_linter = NULL, + object_name_linter = NULL, + object_length_linter(50L), + object_usage_linter = NULL, + string_boundary_linter = NULL, + strings_as_factors_linter = NULL, + todo_comment_linter = NULL, + undesirable_function_linter = NULL, + undesirable_operator_linter = NULL, + unnecessary_concatenation_linter(allow_single_expression = FALSE), + unused_import_linter = NULL, + defaults = linters_with_tags(tags = NULL) + ), exclusions = exclusions_list) shell: Rscript {0} env: LINTR_ERROR_ON_LINT: true diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 26ebe78e..6e722645 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -18,7 +18,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -32,27 +32,33 @@ jobs: local::. needs: lint + # TODO: Revisit to remove some of these allowances after more important lints + # have been removed. - name: Lint run: | + options(crayon.enabled = TRUE) library(lintr) lint_package(linters = linters_with_defaults( absolute_path_linter = NULL, + assignment_linter = NULL, commented_code_linter = NULL, - cyclocomp_linter(20L), + cyclocomp_linter(25L), extraction_operator_linter = NULL, implicit_integer_linter = NULL, + library_call_linter = NULL, line_length_linter(120L), + namespace_linter = NULL, + nonportable_path_linter = NULL, object_name_linter = NULL, object_length_linter(50L), object_usage_linter = NULL, - nonportable_path_linter = NULL, string_boundary_linter = NULL, strings_as_factors_linter = NULL, todo_comment_linter = NULL, undesirable_function_linter = NULL, + undesirable_operator_linter = NULL, + unnecessary_concatenation_linter(allow_single_expression = FALSE), unused_import_linter = NULL, defaults = linters_with_tags(tags = NULL) )) shell: Rscript {0} - # env: - # LINTR_ERROR_ON_LINT: true diff --git a/.github/workflows/pkgdown-no-suggests.yaml b/.github/workflows/pkgdown-no-suggests.yaml index e40edecf..eb0b1fbf 100644 --- a/.github/workflows/pkgdown-no-suggests.yaml +++ b/.github/workflows/pkgdown-no-suggests.yaml @@ -21,11 +21,11 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 0e6abe5b..a676b429 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -20,11 +20,11 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: "3.1.5" + pandoc-version: "3.1.7" - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 8fd88fb3..5ff53fe3 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -19,7 +19,7 @@ jobs: with: access_token: ${{ github.token }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/styler.yaml b/.github/workflows/styler.yaml index 14615579..77cac5a9 100644 --- a/.github/workflows/styler.yaml +++ b/.github/workflows/styler.yaml @@ -13,7 +13,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/test-coverage-examples.yaml b/.github/workflows/test-coverage-examples.yaml index 165144ea..20f2498d 100644 --- a/.github/workflows/test-coverage-examples.yaml +++ b/.github/workflows/test-coverage-examples.yaml @@ -15,7 +15,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 25bc314e..f6529b12 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -15,7 +15,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.lintr b/.lintr index 5f8d3707..e3a82a21 100644 --- a/.lintr +++ b/.lintr @@ -1,18 +1,23 @@ linters: linters_with_defaults( absolute_path_linter = NULL, + assignment_linter = NULL, commented_code_linter = NULL, - cyclocomp_linter = cyclocomp_linter(20), + cyclocomp_linter(25L), extraction_operator_linter = NULL, implicit_integer_linter = NULL, - line_length_linter(120), + library_call_linter = NULL, + line_length_linter(120L), + namespace_linter = NULL, + nonportable_path_linter = NULL, object_name_linter = NULL, - object_length_linter(50), + object_length_linter(50L), object_usage_linter = NULL, - nonportable_path_linter = NULL, + todo_comment_linter = NULL, string_boundary_linter = NULL, strings_as_factors_linter = NULL, - todo_comment_linter = NULL, undesirable_function_linter = NULL, + undesirable_operator_linter = NULL, + unnecessary_concatenation_linter(allow_single_expression = FALSE), unused_import_linter = NULL, defaults = linters_with_tags(tags = NULL) ) diff --git a/CITATION.cff b/CITATION.cff index f7d2b1c2..8c7df64b 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "statsExpressions" in publications use:' type: software license: GPL-3.0-only title: 'statsExpressions: Tidy Dataframes and Expressions with Statistical Details' -version: 1.5.1 +version: 1.5.2 doi: 10.21105/joss.03236 abstract: 'Utilities for producing dataframes with rich details for the most common types of statistical approaches and tests: parametric, nonparametric, robust, and @@ -116,7 +116,7 @@ references: abstract: 'correlation: Methods for Correlation Analysis' notes: Imports url: https://easystats.github.io/correlation/ - repository: https://CRAN.R-project.org/package=correlation + repository: https://easystats.r-universe.dev authors: - family-names: Makowski given-names: Dominique @@ -138,6 +138,10 @@ references: given-names: Mattan S. email: matanshm@post.bgu.ac.il orcid: https://orcid.org/0000-0002-4287-4801 + - family-names: Thériault + given-names: Rémi + email: remi.theriault@mail.mcgill.ca + orcid: https://orcid.org/0000-0003-4315-6788 year: '2023' version: '>= 0.8.4' - type: software @@ -197,13 +201,13 @@ references: email: davis@posit.co orcid: https://orcid.org/0000-0003-4777-038X year: '2023' - version: '>= 1.1.2' + version: '>= 1.1.3' - type: software title: effectsize abstract: 'effectsize: Indices of Effect Size' notes: Imports url: https://easystats.github.io/effectsize/ - repository: https://easystats.r-universe.dev + repository: https://CRAN.R-project.org/package=effectsize authors: - family-names: Ben-Shachar given-names: Mattan S. @@ -230,7 +234,7 @@ references: email: remi.theriault@mail.mcgill.ca orcid: https://orcid.org/0000-0003-4315-6788 year: '2023' - version: '>= 0.8.3' + version: '>= 0.8.5' - type: software title: glue abstract: 'glue: Interpreted String Literals' @@ -286,7 +290,7 @@ references: email: etienne.bacher@protonmail.com orcid: https://orcid.org/0000-0002-9271-5075 year: '2023' - version: '>= 0.19.3' + version: '>= 0.19.4' - type: software title: magrittr abstract: 'magrittr: A Forward-Pipe Operator for R' @@ -365,7 +369,7 @@ references: email: brenton@wiernik.org orcid: https://orcid.org/0000-0001-9560-6336 year: '2023' - version: '>= 0.10.3' + version: '>= 0.10.4' - type: software title: PMCMRplus abstract: 'PMCMRplus: Calculate Pairwise Multiple Comparisons of Mean Rank Sums @@ -394,7 +398,7 @@ references: given-names: Lionel email: lionel@rstudio.com year: '2023' - version: '>= 1.0.1' + version: '>= 1.0.2' - type: software title: rlang abstract: 'rlang: Functions for Base Types and Core R and ''Tidyverse'' Features' @@ -502,6 +506,38 @@ references: given-names: Nathan email: nathanteetor@gmail.com year: '2023' +- type: software + title: bayestestR + abstract: 'bayestestR: Understand and Describe Bayesian Models and Posterior Distributions' + notes: Suggests + url: https://easystats.github.io/bayestestR/ + repository: https://easystats.r-universe.dev + authors: + - family-names: Makowski + given-names: Dominique + email: dom.makowski@gmail.com + orcid: https://orcid.org/0000-0001-5375-9967 + - family-names: Lüdecke + given-names: Daniel + email: d.luedecke@uke.de + orcid: https://orcid.org/0000-0002-8895-3206 + - family-names: Ben-Shachar + given-names: Mattan S. + email: matanshm@post.bgu.ac.il + orcid: https://orcid.org/0000-0002-4287-4801 + - family-names: Patil + given-names: Indrajeet + email: patilindrajeet.science@gmail.com + orcid: https://orcid.org/0000-0003-1995-6531 + - family-names: Wilson + given-names: Michael D. + email: michael.d.wilson@curtin.edu.au + orcid: https://orcid.org/0000-0003-4143-7308 + - family-names: Wiernik + given-names: Brenton M. + email: brenton@wiernik.org + orcid: https://orcid.org/0000-0001-9560-6336 + year: '2023' - type: software title: ggplot2 abstract: 'ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics' @@ -671,7 +707,7 @@ references: given-names: Hadley email: hadley@posit.co year: '2023' - version: '>= 3.1.8' + version: '>= 3.1.10' - type: software title: utils abstract: 'R: A Language and Environment for Statistical Computing' diff --git a/DESCRIPTION b/DESCRIPTION index 068b95c6..7f4c4383 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: statsExpressions Title: Tidy Dataframes and Expressions with Statistical Details -Version: 1.5.1 +Version: 1.5.2 Authors@R: person(given = "Indrajeet", family = "Patil", @@ -29,15 +29,15 @@ Imports: BayesFactor (>= 0.9.12-4.4), correlation (>= 0.8.4), datawizard (>= 0.8.0), - dplyr (>= 1.1.2), - effectsize (>= 0.8.3), + dplyr (>= 1.1.3), + effectsize (>= 0.8.5), glue, - insight (>= 0.19.3), + insight (>= 0.19.4), magrittr, parameters (>= 0.21.1), - performance (>= 0.10.3), + performance (>= 0.10.4), PMCMRplus (>= 1.9.7), - purrr (>= 1.0.1), + purrr (>= 1.0.2), rlang, stats, tibble (>= 3.2.1), @@ -46,6 +46,7 @@ Imports: WRS2, zeallot Suggests: + bayestestR, ggplot2, knitr, metaBMA, @@ -54,7 +55,7 @@ Suggests: rmarkdown, rstantools, survival, - testthat (>= 3.1.8), + testthat (>= 3.1.10), utils VignetteBuilder: knitr diff --git a/NEWS.md b/NEWS.md index 9a7b8179..266f0634 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# statsExpressions 1.5.2 + +- Fixes failures on R-devel due to changes in the formula interface for a paired test. + # statsExpressions 1.5.1 ## MAJOR CHANGES diff --git a/R/add_expression_col.R b/R/add_expression_col.R index 060e33a7..3ea05f1e 100644 --- a/R/add_expression_col.R +++ b/R/add_expression_col.R @@ -91,13 +91,13 @@ add_expression_col <- function(data, ...) { if (!"n.obs" %in% colnames(data)) data %<>% mutate(n.obs = n) if (!"effectsize" %in% colnames(data)) data %<>% mutate(effectsize = method) - data %<>% rename_all(.funs = recode, "bayes.factor" = "bf10") + data %<>% rename_with(recode, bayes.factor = "bf10") bayesian <- any("bf10" == colnames(data)) no.parameters <- sum("df.error" %in% names(data) + "df" %in% names(data)) # special case for Bayesian contingency table analysis - if (bayesian && grepl("contingency", data$method[[1]], fixed = TRUE)) data %<>% mutate(effectsize = "Cramers_v") + if (bayesian && grepl("contingency", data$method[[1L]], fixed = TRUE)) data %<>% mutate(effectsize = "Cramers_v") # convert needed columns to character type df_expr <- .data_to_char(data, k, k.df, k.df.error) @@ -169,7 +169,7 @@ add_expression_col <- function(data, across(.fns = ~ .to_char(.x, k), .cols = matches("^est|^sta|p.value|.scale$|.low$|.high$|^log")), across(.fns = ~ .to_char(.x, k.df), .cols = matches("^df$")), across(.fns = ~ .to_char(.x, k.df.error), .cols = matches("^df.error$")), - across(.fns = ~ paste0(.x * 100, "%"), .cols = matches("^conf.level$")) + across(.fns = ~ paste0(.x * 100L, "%"), .cols = matches("^conf.level$")) ) } diff --git a/R/contingency_table.R b/R/contingency_table.R index 3c2bf600..991bd945 100644 --- a/R/contingency_table.R +++ b/R/contingency_table.R @@ -101,7 +101,7 @@ contingency_table <- function(data, conf.level = 0.95, sampling.plan = "indepMulti", fixed.margin = "rows", - prior.concentration = 1, + prior.concentration = 1.0, ...) { type <- stats_type_switch(type) test <- ifelse(quo_is_null(enquo(y)), "1way", "2way") @@ -163,7 +163,7 @@ contingency_table <- function(data, } p1s <- rdirichlet(n = 100000L, alpha = prior.concentration * ratio) - pr_h1 <- map_dbl(1:100000, ~ stats::dmultinom(as.matrix(xtab), prob = p1s[.x, ], log = TRUE)) + pr_h1 <- map_dbl(1:100000L, ~ stats::dmultinom(as.matrix(xtab), prob = p1s[.x, ], log = TRUE)) # BF = (log) prob of data under alternative - (log) prob of data under null # computing Bayes Factor and formatting the results diff --git a/R/global_vars.R b/R/global_vars.R index debea9b2..9d4dfa5c 100644 --- a/R/global_vars.R +++ b/R/global_vars.R @@ -33,7 +33,8 @@ utils::globalVariables( "group2", "log_e_bf10", "p_adjust_text", - "n.obs" + "n.obs", + "r.squared" ), package = "statsExpressions", add = FALSE diff --git a/R/helpers_easystats.R b/R/helpers_easystats.R index 987c904a..e89a0428 100644 --- a/R/helpers_easystats.R +++ b/R/helpers_easystats.R @@ -13,7 +13,7 @@ tidy_model_parameters <- function(model, ...) { select(-matches("Difference")) %>% standardize_names(style = "broom") %>% rename_all(~ gsub("cramers.", "", .x)) %>% - rename_all(.funs = recode, "bayes.factor" = "bf10") %>% + rename_with(recode, bayes.factor = "bf10") %>% tidyr::fill(matches("^prior|^bf"), .direction = "updown") %>% mutate(across(matches("bf10"), ~ log(.x), .names = "log_e_{.col}")) @@ -26,7 +26,7 @@ tidy_model_parameters <- function(model, ...) { df_r2 <- performance::r2_bayes(model, average = TRUE, verbose = FALSE, ci = stats_df$conf.level[[1]]) %>% as_tibble() %>% standardize_names(style = "broom") %>% - rename("estimate" = "r.squared") %>% + rename(estimate = r.squared) %>% filter(if_any(matches("component"), ~ (.x == "conditional"))) # remove estimates and CIs and use R2 data frame instead diff --git a/R/long_to_wide_converter.R b/R/long_to_wide_converter.R index 8481a918..7bfdf515 100644 --- a/R/long_to_wide_converter.R +++ b/R/long_to_wide_converter.R @@ -1,4 +1,4 @@ -#' @title Convert long/tidy data frame to wide format with `NA`s removed +#' @title Convert long/tidy data frame to wide format #' @name long_to_wide_converter #' #' @description @@ -6,10 +6,6 @@ #' This conversion is helpful mostly for repeated measures design, where #' removing `NA`s by participant can be a bit tedious. #' -#' It does not make sense to spread the data frame to wide format when the -#' measure is not repeated, so if `paired = TRUE`, `spread` argument will be -#' ignored. -#' #' @param data A data frame (or a tibble) from which variables specified are to #' be taken. Other data types (e.g., matrix,table, array, etc.) will **not** #' be accepted. Additionally, grouped data frames from `{dplyr}` should be @@ -35,8 +31,7 @@ #' repeated measures/within-subjects or between-subjects. The default is #' `FALSE`. #' @param spread Logical that decides whether the data frame needs to be -#' converted from long/tidy to wide (default: `TRUE`). Relevant only if -#' `paired = TRUE`. +#' converted from long/tidy to wide (default: `TRUE`). #' @param ... Currently ignored. #' #' @return A data frame with `NA`s removed while respecting the @@ -49,20 +44,13 @@ #' #' # repeated measures design #' long_to_wide_converter( -#' data = bugs_long, -#' x = condition, -#' y = desire, +#' bugs_long, condition, desire, #' subject.id = subject, -#' paired = TRUE +#' paired = TRUE #' ) #' #' # independent measures design -#' long_to_wide_converter( -#' data = mtcars, -#' x = cyl, -#' y = wt, -#' paired = FALSE -#' ) +#' long_to_wide_converter(mtcars, cyl, wt, paired = FALSE) #' @export long_to_wide_converter <- function(data, x, @@ -90,10 +78,10 @@ long_to_wide_converter <- function(data, ungroup() %>% nest_by(.rowid, .key = "nested_data") %>% filter(sum(is.na(nested_data)) == 0L) %>% - tidyr::unnest(cols = c(nested_data)) + tidyr::unnest(cols = nested_data) # convert to wide? - if (spread && paired) data %<>% tidyr::pivot_wider(names_from = {{ x }}, values_from = {{ y }}) + if (spread) data %<>% tidyr::pivot_wider(names_from = {{ x }}, values_from = {{ y }}) as_tibble(relocate(data, .rowid) %>% arrange(.rowid)) } diff --git a/R/meta_analysis.R b/R/meta_analysis.R index 4ea9e0ab..9d1faa76 100644 --- a/R/meta_analysis.R +++ b/R/meta_analysis.R @@ -41,38 +41,27 @@ #' set.seed(123) #' library(statsExpressions) #' -#' # a data frame with estimates and standard errors -#' # (`mag` dataset from `{metaplus}`) -#' df <- tibble::tribble( -#' ~study, ~estimate, ~std.error, -#' "Abraham", -0.83, 1.247, -#' "Bertschat", -1.056, 0.414, -#' "Ceremuzynski", -1.278, 0.808, -#' "Feldstedt", -0.043, 1.429, -#' "Golf", 0.223, 0.489, -#' "ISIS-4", -2.407, 1.072, -#' "LIMIT-2", -1.28, 1.193, -#' "Morton", -1.191, 1.661, -#' "Pereira", -0.695, 0.536, -#' "Rasmussen", -2.208, 1.109, -#' "Schechter", -2.038, 0.78, -#' "Schechter 1", -0.85, 0.618, -#' "Schechter 2", -0.793, 0.625, -#' "Singh", -0.299, 0.146, -#' "Smith", -1.57, 0.574, -#' "Thogersen", 0.057, 0.031 -#' ) -#' -#' # parametric -#' meta_analysis(df) +#' @examplesIf requireNamespace("metaplus", quietly = TRUE) +#' +#' # let's use `mag` dataset from `{metaplus}` +#' data(mag, package = "metaplus") +#' dat <- dplyr::rename(mag, estimate = yi, std.error = sei) +#' +#' # ----------------------- parametric ------------------------------------- +#' +#' meta_analysis(dat) #' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metaplus", quietly = TRUE) -#' # robust -#' meta_analysis(df, type = "random", random = "normal") +#' +#' # ----------------------- robust ---------------------------------- +#' +#' meta_analysis(dat, type = "random", random = "normal") #' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metaBMA", quietly = TRUE) -#' # Bayesian -#' meta_analysis(df, type = "bayes") +#' +#' # ----------------------- Bayesian ---------------------------------- +#' +#' suppressWarnings(meta_analysis(dat, type = "bayes")) #' #' @export meta_analysis <- function(data, @@ -85,9 +74,9 @@ meta_analysis <- function(data, # nolint start: line_length_linter. c(.ns, .fn, .f.args) %<-% switch(type, - "parametric" = list("metafor", "rma", list(yi = quote(estimate), sei = quote(std.error), ...)), - "robust" = list("metaplus", "metaplus", list(yi = quote(estimate), sei = quote(std.error), random = random, ...)), - "bayes" = list("metaBMA", "meta_random", list(y = quote(estimate), SE = quote(std.error), ...)) + parametric = list("metafor", "rma", list(yi = quote(estimate), sei = quote(std.error), ...)), + robust = list("metaplus", "metaplus", list(yi = quote(estimate), sei = quote(std.error), random = random, ...)), + bayes = list("metaBMA", "meta_random", list(y = quote(estimate), SE = quote(std.error), ...)) ) # nolint end diff --git a/R/oneway_anova.R b/R/oneway_anova.R index 48e38ec3..fdba82a4 100644 --- a/R/oneway_anova.R +++ b/R/oneway_anova.R @@ -155,7 +155,7 @@ oneway_anova <- function(data, # parametric --------------------------------------- if (type == "parametric") { - c(k.df, k.df.error) %<-% c(ifelse(!paired, 0L, k), ifelse(!paired && var.equal, 0L, k)) + c(k.df, k.df.error) %<-% c(ifelse(paired, k, 0L), ifelse(!paired && var.equal, 0L, k)) # styler: off if (effsize.type %in% c("unbiased", "omega")) .f.es <- effectsize::omega_squared diff --git a/R/pairwise_comparisons.R b/R/pairwise_comparisons.R index a7a1c399..b45a04b1 100644 --- a/R/pairwise_comparisons.R +++ b/R/pairwise_comparisons.R @@ -197,6 +197,7 @@ pairwise_comparisons <- function(data, !!!.f.args )) %>% tidy_model_parameters() %>% + select(-matches("^parameter1$|^parameter2$")) %>% rename(group2 = group1, group1 = group2) } diff --git a/R/tidy_model_expressions.R b/R/tidy_model_expressions.R index 72dd0e95..3247d3bf 100644 --- a/R/tidy_model_expressions.R +++ b/R/tidy_model_expressions.R @@ -45,7 +45,7 @@ tidy_model_expressions <- function(data, # convert the necessary columns to character type for expression df <- data %>% filter(if_all( - .cols = c(matches("estimate|statistic|std.error|p.value")), + .cols = matches("estimate|statistic|std.error|p.value"), .fns = Negate(is.na) )) %>% .data_to_char(k) @@ -88,11 +88,7 @@ tidy_model_expressions <- function(data, # nolint end - # add the `expression` column to the original data frame - # - # the rows for which no expression was created will have `NA`s in this column, - # which should instead be replaced with `NULL`, which when parsed in the plotting - # context, will not show anything instead of empty string + # Replace `NA` with `NULL` to show nothing instead of an empty string ("") left_join(data, select(df, term, expression), by = "term") %>% .glue_to_expression() } diff --git a/R/two_sample_test.R b/R/two_sample_test.R index 531cf4c8..2f652ed0 100644 --- a/R/two_sample_test.R +++ b/R/two_sample_test.R @@ -132,7 +132,7 @@ two_sample_test <- function(data, y = {{ y }}, subject.id = {{ subject.id }}, paired = paired, - spread = ifelse(type %in% c("bayes", "robust"), paired, FALSE) + spread = ifelse(type %in% c("bayes", "robust"), paired, TRUE) ) # parametric --------------------------------------- @@ -151,26 +151,12 @@ two_sample_test <- function(data, if (type == "nonparametric") c(.f, .f.es) %<-% c(stats::wilcox.test, effectsize::rank_biserial) if (type %in% c("parametric", "nonparametric")) { - stats_df <- exec( - .f, - formula = new_formula(y, x), - data = data, - paired = paired, - alternative = alternative, - var.equal = var.equal, - exact = FALSE - ) %>% + .f.args <- list(x = data[[2L]], y = data[[3L]], paired = paired, alternative = alternative) + + stats_df <- exec(.f, !!!.f.args, var.equal = var.equal, exact = FALSE) %>% tidy_model_parameters() - effsize_df <- exec( - .f.es, - x = new_formula(y, x), - data = data, - paired = paired, - pooled_sd = FALSE, - ci = conf.level, - verbose = FALSE - ) %>% + effsize_df <- exec(.f.es, !!!.f.args, pooled_sd = FALSE, ci = conf.level, verbose = FALSE) %>% tidy_model_effectsize() } @@ -210,10 +196,19 @@ two_sample_test <- function(data, # expression --------------------------------------- add_expression_col( - data = stats_df, - paired = paired, - n = ifelse(paired, length(unique(data$.rowid)), nrow(data)), - k = k, - k.df = k.df + data = if (type == "bayes") stats_df else .standardize_two_sample_terms(stats_df, as_name(x), as_name(y)), + paired = paired, + n = ifelse(paired, length(unique(data$.rowid)), nrow(data)), + k = k, + k.df = k.df ) } + +#' @noRd +.standardize_two_sample_terms <- function(data, x_name, y_name) { + data %>% + mutate( + across(matches("^parameter1$|^term$"), ~y_name), + across(matches("^parameter2$|^group$"), ~x_name) + ) +} diff --git a/codemeta.json b/codemeta.json index a9c62eb2..e2c06175 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,13 +8,13 @@ "codeRepository": "https://github.com/IndrajeetPatil/statsExpressions", "issueTracker": "https://github.com/IndrajeetPatil/statsExpressions/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "1.5.1", + "version": "1.5.2", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.3.0 (2023-04-21)", + "runtimePlatform": "R version 4.3.1 (2023-06-16)", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -49,6 +49,18 @@ } ], "softwareSuggestions": [ + { + "@type": "SoftwareApplication", + "identifier": "bayestestR", + "name": "bayestestR", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=bayestestR" + }, { "@type": "SoftwareApplication", "identifier": "ggplot2", @@ -149,7 +161,7 @@ "@type": "SoftwareApplication", "identifier": "testthat", "name": "testthat", - "version": ">= 3.1.8", + "version": ">= 3.1.10", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -227,7 +239,7 @@ "@type": "SoftwareApplication", "identifier": "dplyr", "name": "dplyr", - "version": ">= 1.1.2", + "version": ">= 1.1.3", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -240,7 +252,7 @@ "@type": "SoftwareApplication", "identifier": "effectsize", "name": "effectsize", - "version": ">= 0.8.3", + "version": ">= 0.8.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -265,7 +277,7 @@ "@type": "SoftwareApplication", "identifier": "insight", "name": "insight", - "version": ">= 0.19.3", + "version": ">= 0.19.4", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -303,7 +315,7 @@ "@type": "SoftwareApplication", "identifier": "performance", "name": "performance", - "version": ">= 0.10.3", + "version": ">= 0.10.4", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -329,7 +341,7 @@ "@type": "SoftwareApplication", "identifier": "purrr", "name": "purrr", - "version": ">= 1.0.1", + "version": ">= 1.0.2", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -419,7 +431,7 @@ }, "SystemRequirements": null }, - "fileSize": "4132.001KB", + "fileSize": "4130.563KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/cran-comments.md b/cran-comments.md index a8ecfc0c..10898340 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,7 +2,7 @@ 0 errors | 0 warnings | 0 note -* Maintenance release. +* ixes failures on R-devel due to changes in the formula interface for a paired test. ## revdepcheck results diff --git a/man/long_to_wide_converter.Rd b/man/long_to_wide_converter.Rd index 714ce960..f367f207 100644 --- a/man/long_to_wide_converter.Rd +++ b/man/long_to_wide_converter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/long_to_wide_converter.R \name{long_to_wide_converter} \alias{long_to_wide_converter} -\title{Convert long/tidy data frame to wide format with \code{NA}s removed} +\title{Convert long/tidy data frame to wide format} \usage{ long_to_wide_converter( data, @@ -45,8 +45,7 @@ repeated measures/within-subjects or between-subjects. The default is \code{FALSE}.} \item{spread}{Logical that decides whether the data frame needs to be -converted from long/tidy to wide (default: \code{TRUE}). Relevant only if -\code{paired = TRUE}.} +converted from long/tidy to wide (default: \code{TRUE}).} \item{...}{Currently ignored.} } @@ -57,10 +56,6 @@ between-or-within-subjects nature of the dataset. \description{ This conversion is helpful mostly for repeated measures design, where removing \code{NA}s by participant can be a bit tedious. - -It does not make sense to spread the data frame to wide format when the -measure is not repeated, so if \code{paired = TRUE}, \code{spread} argument will be -ignored. } \examples{ # for reproducibility @@ -69,18 +64,11 @@ set.seed(123) # repeated measures design long_to_wide_converter( - data = bugs_long, - x = condition, - y = desire, + bugs_long, condition, desire, subject.id = subject, - paired = TRUE + paired = TRUE ) # independent measures design -long_to_wide_converter( - data = mtcars, - x = cyl, - y = wt, - paired = FALSE -) +long_to_wide_converter(mtcars, cyl, wt, paired = FALSE) } diff --git a/man/meta_analysis.Rd b/man/meta_analysis.Rd index af449e2d..0af7f8c4 100644 --- a/man/meta_analysis.Rd +++ b/man/meta_analysis.Rd @@ -103,38 +103,27 @@ The table below provides summary about: # setup set.seed(123) library(statsExpressions) +\dontshow{\}) # examplesIf} +\dontshow{if (requireNamespace("metaplus", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} -# a data frame with estimates and standard errors -# (`mag` dataset from `{metaplus}`) -df <- tibble::tribble( - ~study, ~estimate, ~std.error, - "Abraham", -0.83, 1.247, - "Bertschat", -1.056, 0.414, - "Ceremuzynski", -1.278, 0.808, - "Feldstedt", -0.043, 1.429, - "Golf", 0.223, 0.489, - "ISIS-4", -2.407, 1.072, - "LIMIT-2", -1.28, 1.193, - "Morton", -1.191, 1.661, - "Pereira", -0.695, 0.536, - "Rasmussen", -2.208, 1.109, - "Schechter", -2.038, 0.78, - "Schechter 1", -0.85, 0.618, - "Schechter 2", -0.793, 0.625, - "Singh", -0.299, 0.146, - "Smith", -1.57, 0.574, - "Thogersen", 0.057, 0.031 -) +# let's use `mag` dataset from `{metaplus}` +data(mag, package = "metaplus") +dat <- dplyr::rename(mag, estimate = yi, std.error = sei) -# parametric -meta_analysis(df) +# ----------------------- parametric ------------------------------------- + +meta_analysis(dat) \dontshow{\}) # examplesIf} \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metaplus", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} -# robust -meta_analysis(df, type = "random", random = "normal") + +# ----------------------- robust ---------------------------------- + +meta_analysis(dat, type = "random", random = "normal") \dontshow{\}) # examplesIf} \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metaBMA", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} -# Bayesian -meta_analysis(df, type = "bayes") + +# ----------------------- Bayesian ---------------------------------- + +suppressWarnings(meta_analysis(dat, type = "bayes")) \dontshow{\}) # examplesIf} } diff --git a/tests/testthat/_snaps/long_to_wide_converter.md b/tests/testthat/_snaps/long_to_wide_converter.md index 9ec88a62..2c7cf14e 100644 --- a/tests/testthat/_snaps/long_to_wide_converter.md +++ b/tests/testthat/_snaps/long_to_wide_converter.md @@ -13,8 +13,8 @@ Rows: 32 Columns: 3 $ .rowid 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ~ - $ am 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, ~ - $ wt 3.215, 3.440, 3.460, 3.570, 3.190, 3.150, 3.440, 3.440, 4.070, ~ + $ `0` 3.215, 3.440, 3.460, 3.570, 3.190, 3.150, 3.440, 3.440, 4.070, ~ + $ `1` NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,~ Rows: 88 Columns: 5 $ .rowid 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,~ @@ -23,10 +23,12 @@ $ LDHF 6.0, 10.0, 9.0, 6.5, 0.5, 10.0, 10.0, 9.5, 2.5, 7.5, 8.5, 8.0, ~ $ LDLF 6.0, 5.0, 6.0, 3.0, 2.0, 10.0, 10.0, 9.5, 0.0, 9.5, 7.0, 3.0, 4~ Rows: 51 - Columns: 3 + Columns: 5 $ .rowid 3, 4, 5, 7, 9, 12, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29,~ - $ vore carni, carni, carni, carni, carni, carni, carni, carni, carni,~ - $ brainwt 0.07000, 0.01080, 0.02560, 0.32500, 0.01250, 0.15700, 0.01750,~ + $ carni 0.0700, 0.0108, 0.0256, 0.3250, 0.0125, 0.1570, 0.0175, 0.0445~ + $ herbi NA, NA, NA, NA, NA, NA, NA, NA, NA, 0.42300, 0.09820, 0.11500,~ + $ insecti NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA~ + $ omni NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA~ --- @@ -50,13 +52,14 @@ Max. :4.400 [[2]] - .rowid am wt - Min. : 1.00 0:19 Min. :1.513 - 1st Qu.: 8.75 1:13 1st Qu.:2.581 - Median :16.50 Median :3.325 - Mean :16.50 Mean :3.217 - 3rd Qu.:24.25 3rd Qu.:3.610 - Max. :32.00 Max. :5.424 + .rowid 0 1 + Min. : 1.00 Min. :2.465 Min. :1.513 + 1st Qu.: 8.75 1st Qu.:3.438 1st Qu.:1.935 + Median :16.50 Median :3.520 Median :2.320 + Mean :16.50 Mean :3.769 Mean :2.411 + 3rd Qu.:24.25 3rd Qu.:3.842 3rd Qu.:2.780 + Max. :32.00 Max. :5.424 Max. :3.570 + NA's :13 NA's :19 [[3]] .rowid HDHF HDLF LDHF @@ -75,13 +78,22 @@ Max. :10.000 [[4]] - .rowid vore brainwt - Min. : 3.00 carni : 9 Min. :0.00014 - 1st Qu.:25.50 herbi :20 1st Qu.:0.00375 - Median :46.00 insecti: 5 Median :0.01550 - Mean :42.96 omni :17 Mean :0.30844 - 3rd Qu.:61.50 3rd Qu.:0.16300 - Max. :76.00 Max. :5.71200 + .rowid carni herbi insecti + Min. : 3.00 Min. :0.01080 Min. :0.000400 Min. :0.00025 + 1st Qu.:25.50 1st Qu.:0.01750 1st Qu.:0.005125 1st Qu.:0.00030 + Median :46.00 Median :0.04450 Median :0.012285 Median :0.00120 + Mean :42.96 Mean :0.07926 Mean :0.621598 Mean :0.02155 + 3rd Qu.:61.50 3rd Qu.:0.07000 3rd Qu.:0.236000 3rd Qu.:0.02500 + Max. :76.00 Max. :0.32500 Max. :5.712000 Max. :0.08100 + NA's :42 NA's :31 NA's :46 + omni + Min. :0.00014 + 1st Qu.:0.00260 + Median :0.00660 + Mean :0.14573 + 3rd Qu.:0.17900 + Max. :1.32000 + NA's :34 # long_to_wide_converter works - spread false diff --git a/tests/testthat/_snaps/one_two_sample_dataframes.md b/tests/testthat/_snaps/one_two_sample_dataframes.md index 6c36d521..434b960a 100644 --- a/tests/testthat/_snaps/one_two_sample_dataframes.md +++ b/tests/testthat/_snaps/one_two_sample_dataframes.md @@ -29,24 +29,24 @@ df_2_between Output # A tibble: 4 x 18 - term group mean.group1 mean.group2 statistic df.error p.value - - 1 wt am 3.77 2.41 5.26 30 0.0000113 - 2 wt am 3.77 2.41 5.49 29.2 1.00 - 3 wt am 3.77 2.41 5.26 30 0.00000563 - 4 wt am 3.77 2.41 5.49 29.2 0.00000627 - method alternative effectsize estimate conf.level conf.low - - 1 Two Sample t-test two.sided Cohen's d 1.93 0.89 1.23 - 2 Welch Two Sample t-test less Hedges' g 1.88 0.99 0.793 - 3 Two Sample t-test greater Cohen's d 1.93 0.9 1.21 - 4 Welch Two Sample t-test two.sided Hedges' g 1.88 0.5 1.58 - conf.high conf.method conf.distribution n.obs expression - - 1 2.61 ncp t 32 - 2 2.97 ncp t 32 - 3 2.63 ncp t 32 - 4 2.15 ncp t 32 + parameter1 parameter2 mean.parameter1 mean.parameter2 statistic df.error + + 1 wt am 3.77 2.41 5.26 30 + 2 wt am 3.77 2.41 5.49 29.2 + 3 wt am 3.77 2.41 5.26 30 + 4 wt am 3.77 2.41 5.49 29.2 + p.value method alternative effectsize estimate conf.level + + 1 0.0000113 Two Sample t-test two.sided Cohen's d 1.93 0.89 + 2 1.00 Welch Two Sample t-test less Hedges' g 1.88 0.99 + 3 0.00000563 Two Sample t-test greater Cohen's d 1.93 0.9 + 4 0.00000627 Welch Two Sample t-test two.sided Hedges' g 1.88 0.5 + conf.low conf.high conf.method conf.distribution n.obs expression + + 1 1.23 2.61 ncp t 32 + 2 -Inf 2.86 ncp t 32 + 3 1.36 Inf ncp t 32 + 4 1.58 2.15 ncp t 32 --- diff --git a/tests/testthat/_snaps/two_sample_parametric.md b/tests/testthat/_snaps/two_sample_parametric.md index 7834debf..c46e83af 100644 --- a/tests/testthat/_snaps/two_sample_parametric.md +++ b/tests/testthat/_snaps/two_sample_parametric.md @@ -4,12 +4,12 @@ select(df1, -expression) Output # A tibble: 1 x 17 - term group mean.group1 mean.group2 statistic df.error p.value - - 1 len supp 20.7 17.0 1.92 58 0.0604 - method alternative effectsize estimate conf.level conf.low - - 1 Two Sample t-test two.sided Cohen's d 0.495 0.99 -0.184 + parameter1 parameter2 mean.parameter1 mean.parameter2 statistic df.error + + 1 len supp 20.7 17.0 1.92 58 + p.value method alternative effectsize estimate conf.level conf.low + + 1 0.0604 Two Sample t-test two.sided Cohen's d 0.495 0.99 -0.184 conf.high conf.method conf.distribution n.obs 1 1.17 ncp t 60 @@ -32,15 +32,15 @@ select(df1, -expression) Output # A tibble: 1 x 17 - term group mean.group1 mean.group2 statistic df.error p.value - - 1 len supp 20.7 17.0 1.92 55.3 0.0606 - method alternative effectsize estimate conf.level conf.low - - 1 Welch Two Sample t-test two.sided Hedges' g 0.488 0.9 0.0599 - conf.high conf.method conf.distribution n.obs - - 1 0.911 ncp t 60 + parameter1 parameter2 mean.parameter1 mean.parameter2 statistic df.error + + 1 len supp 20.7 17.0 1.92 55.3 + p.value method alternative effectsize estimate conf.level + + 1 0.0606 Welch Two Sample t-test two.sided Hedges' g 0.488 0.9 + conf.low conf.high conf.method conf.distribution n.obs + + 1 0.0599 0.911 ncp t 60 --- diff --git a/tests/testthat/test-meta_random_bayes.R b/tests/testthat/test-meta_random_bayes.R index e711abbb..4809cf81 100644 --- a/tests/testthat/test-meta_random_bayes.R +++ b/tests/testthat/test-meta_random_bayes.R @@ -2,8 +2,6 @@ # Bayesian meta-analysis often crashes R session on macOS # this makes sure this test will be run after all others - - test_that( desc = "meta_analysis works - bayesian", code = { @@ -11,7 +9,7 @@ test_that( skip_if_not_installed("metaplus") data(mag, package = "metaplus") - dat <- mag %>% rename(estimate = yi, std.error = sei) + dat <- dplyr::rename(mag, estimate = yi, std.error = sei) set.seed(123) df <- suppressWarnings(meta_analysis( diff --git a/tests/testthat/test-two_sample_robust.R b/tests/testthat/test-two_sample_robust.R index 19a3c3af..302e6dbd 100644 --- a/tests/testthat/test-two_sample_robust.R +++ b/tests/testthat/test-two_sample_robust.R @@ -3,7 +3,6 @@ test_that( desc = "t_robust - within-subjects - without NAs", code = { - # subtitle set.seed(123) df1 <- two_sample_test( type = "r", @@ -26,7 +25,6 @@ test_that( test_that( desc = "t_robust - within-subjects - with NAs", code = { - # subtitle set.seed(123) df1 <- two_sample_test( type = "r", @@ -49,7 +47,7 @@ test_that( code = { # between-subjects ------------------------------------------------------ - # subtitle + set.seed(123) df1 <- two_sample_test( type = "r", From 93e4677f445d8aa66c6a404a3068977f07eb58a4 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 12 Sep 2023 17:01:05 +0200 Subject: [PATCH 2/5] bump to devel extract two sample examples to a separate script --- DESCRIPTION | 4 +- NEWS.md | 2 + R/two_sample_test.R | 85 +--------- man/centrality_description.Rd | 8 +- man/corr_test.Rd | 8 +- .../examples-centrality_description.R | 8 +- man/examples/examples-corr_test.R | 8 +- man/examples/examples-one_sample_test.R | 6 +- .../examples-two_sample_test_between.R | 24 +++ .../examples-two_sample_test_within.R | 23 +++ man/one_sample_test.Rd | 6 +- man/two_sample_test.Rd | 104 ++++--------- vignettes/web_only/dataframe_outputs.Rmd | 145 +----------------- 13 files changed, 111 insertions(+), 320 deletions(-) create mode 100644 man/examples/examples-two_sample_test_between.R create mode 100644 man/examples/examples-two_sample_test_within.R diff --git a/DESCRIPTION b/DESCRIPTION index 7f4c4383..cbfa720b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: statsExpressions Title: Tidy Dataframes and Expressions with Statistical Details -Version: 1.5.2 +Version: 1.5.2.9000 Authors@R: person(given = "Indrajeet", family = "Patil", @@ -35,7 +35,7 @@ Imports: insight (>= 0.19.4), magrittr, parameters (>= 0.21.1), - performance (>= 0.10.4), + performance (>= 0.10.5), PMCMRplus (>= 1.9.7), purrr (>= 1.0.2), rlang, diff --git a/NEWS.md b/NEWS.md index 266f0634..4308a8ea 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# statsExpressions 1.5.2.9000 + # statsExpressions 1.5.2 - Fixes failures on R-devel due to changes in the formula interface for a paired test. diff --git a/R/two_sample_test.R b/R/two_sample_test.R index 2f652ed0..8786df79 100644 --- a/R/two_sample_test.R +++ b/R/two_sample_test.R @@ -25,89 +25,8 @@ #' ``` #' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") -#' # for reproducibility -#' set.seed(123) -#' library(statsExpressions) -#' -#' # parametric ------------------------------------- -#' -#' # between-subjects design -#' two_sample_test( -#' data = sleep, -#' x = group, -#' y = extra, -#' type = "p" -#' ) -#' -#' # within-subjects design -#' two_sample_test( -#' data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")), -#' x = condition, -#' y = desire, -#' paired = TRUE, -#' subject.id = subject, -#' type = "p" -#' ) -#' -#' # non-parametric ---------------------------------- -#' -#' # between-subjects design -#' two_sample_test( -#' data = sleep, -#' x = group, -#' y = extra, -#' type = "np" -#' ) -#' -#' # within-subjects design -#' two_sample_test( -#' data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")), -#' x = condition, -#' y = desire, -#' paired = TRUE, -#' subject.id = subject, -#' type = "np" -#' ) -#' -#' # robust ---------------------------------- -#' -#' # between-subjects design -#' two_sample_test( -#' data = sleep, -#' x = group, -#' y = extra, -#' type = "r" -#' ) -#' -#' # within-subjects design -#' two_sample_test( -#' data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")), -#' x = condition, -#' y = desire, -#' paired = TRUE, -#' subject.id = subject, -#' type = "r" -#' ) -#' -#' #' # Bayesian ------------------------------ -#' -#' # between-subjects design -#' two_sample_test( -#' data = sleep, -#' x = group, -#' y = extra, -#' type = "bayes" -#' ) -#' -#' # within-subjects design -#' two_sample_test( -#' data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")), -#' x = condition, -#' y = desire, -#' paired = TRUE, -#' subject.id = subject, -#' type = "bayes" -#' ) +#' @example man/examples/examples-two_sample_test_within.R +#' @example man/examples/examples-two_sample_test_between.R #' @export two_sample_test <- function(data, x, diff --git a/man/centrality_description.Rd b/man/centrality_description.Rd index 4e048879..436305f7 100644 --- a/man/centrality_description.Rd +++ b/man/centrality_description.Rd @@ -81,17 +81,17 @@ set.seed(123) # ----------------------- parametric ----------------------- -centrality_description(iris, Species, Sepal.Length) +centrality_description(iris, Species, Sepal.Length, type = "parametric") # ----------------------- non-parametric ------------------- -centrality_description(mtcars, am, wt, type = "n") +centrality_description(mtcars, am, wt, type = "nonparametric") # ----------------------- robust --------------------------- -centrality_description(ToothGrowth, supp, len, type = "r") +centrality_description(ToothGrowth, supp, len, type = "robust") # ----------------------- Bayesian ------------------------- -centrality_description(sleep, group, extra, type = "b") +centrality_description(sleep, group, extra, type = "bayes") } diff --git a/man/corr_test.Rd b/man/corr_test.Rd index 0f89cf65..60dd88b8 100644 --- a/man/corr_test.Rd +++ b/man/corr_test.Rd @@ -109,17 +109,17 @@ set.seed(123) # ----------------------- parametric ----------------------- -corr_test(mtcars, wt, mpg) +corr_test(mtcars, wt, mpg, type = "parametric") # ----------------------- non-parametric ------------------- -corr_test(mtcars, wt, mpg, type = "n") +corr_test(mtcars, wt, mpg, type = "nonparametric") # ----------------------- robust --------------------------- -corr_test(mtcars, wt, mpg, type = "r") +corr_test(mtcars, wt, mpg, type = "robust") # ----------------------- Bayesian ------------------------- -corr_test(mtcars, wt, mpg, type = "b") +corr_test(mtcars, wt, mpg, type = "bayes") } diff --git a/man/examples/examples-centrality_description.R b/man/examples/examples-centrality_description.R index 426bfce8..351a51dd 100644 --- a/man/examples/examples-centrality_description.R +++ b/man/examples/examples-centrality_description.R @@ -3,16 +3,16 @@ set.seed(123) # ----------------------- parametric ----------------------- -centrality_description(iris, Species, Sepal.Length) +centrality_description(iris, Species, Sepal.Length, type = "parametric") # ----------------------- non-parametric ------------------- -centrality_description(mtcars, am, wt, type = "n") +centrality_description(mtcars, am, wt, type = "nonparametric") # ----------------------- robust --------------------------- -centrality_description(ToothGrowth, supp, len, type = "r") +centrality_description(ToothGrowth, supp, len, type = "robust") # ----------------------- Bayesian ------------------------- -centrality_description(sleep, group, extra, type = "b") +centrality_description(sleep, group, extra, type = "bayes") diff --git a/man/examples/examples-corr_test.R b/man/examples/examples-corr_test.R index c319fad0..a03e45e4 100644 --- a/man/examples/examples-corr_test.R +++ b/man/examples/examples-corr_test.R @@ -3,16 +3,16 @@ set.seed(123) # ----------------------- parametric ----------------------- -corr_test(mtcars, wt, mpg) +corr_test(mtcars, wt, mpg, type = "parametric") # ----------------------- non-parametric ------------------- -corr_test(mtcars, wt, mpg, type = "n") +corr_test(mtcars, wt, mpg, type = "nonparametric") # ----------------------- robust --------------------------- -corr_test(mtcars, wt, mpg, type = "r") +corr_test(mtcars, wt, mpg, type = "robust") # ----------------------- Bayesian ------------------------- -corr_test(mtcars, wt, mpg, type = "b") +corr_test(mtcars, wt, mpg, type = "bayes") diff --git a/man/examples/examples-one_sample_test.R b/man/examples/examples-one_sample_test.R index d27bec4c..32343613 100644 --- a/man/examples/examples-one_sample_test.R +++ b/man/examples/examples-one_sample_test.R @@ -7,12 +7,12 @@ one_sample_test(mtcars, wt, test.value = 3) # ----------------------- non-parametric ------------------- -one_sample_test(mtcars, wt, test.value = 3, type = "n") +one_sample_test(mtcars, wt, test.value = 3, type = "nonparametric") # ----------------------- robust --------------------------- -one_sample_test(mtcars, wt, test.value = 3, type = "r") +one_sample_test(mtcars, wt, test.value = 3, type = "robust") # ----------------------- Bayesian ------------------------- -one_sample_test(mtcars, wt, test.value = 3, type = "b") +one_sample_test(mtcars, wt, test.value = 3, type = "bayes") diff --git a/man/examples/examples-two_sample_test_between.R b/man/examples/examples-two_sample_test_between.R new file mode 100644 index 00000000..3a437060 --- /dev/null +++ b/man/examples/examples-two_sample_test_between.R @@ -0,0 +1,24 @@ +# ----------------------- between-subjects ------------------------------------- + +# for reproducibility +set.seed(123) + +# ----------------------- parametric --------------------------------------- + +# unequal variance +two_sample_test(ToothGrowth, supp, len, type = "parametric") + +# equal variance +two_sample_test(ToothGrowth, supp, len, type = "parametric", var.equal = TRUE) + +# ----------------------- non-parametric ----------------------------------- + +two_sample_test(ToothGrowth, supp, len, type = "nonparametric") + +# ----------------------- robust -------------------------------------------- + +two_sample_test(ToothGrowth, supp, len, type = "robust") + +# ----------------------- Bayesian --------------------------------------- + +two_sample_test(ToothGrowth, supp, len, type = "bayes") diff --git a/man/examples/examples-two_sample_test_within.R b/man/examples/examples-two_sample_test_within.R new file mode 100644 index 00000000..5cb9bfdb --- /dev/null +++ b/man/examples/examples-two_sample_test_within.R @@ -0,0 +1,23 @@ +# ----------------------- within-subjects ------------------------------------- + +# data +df <- dplyr::filter(bugs_long, condition %in% c("LDLF", "LDHF")) + +# for reproducibility +set.seed(123) + +# ----------------------- parametric --------------------------------------- + +two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "parametric") + +# ----------------------- non-parametric ----------------------------------- + +two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "nonparametric") + +# ----------------------- robust -------------------------------------------- + +two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "robust") + +# ----------------------- Bayesian --------------------------------------- + +two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "bayes") diff --git a/man/one_sample_test.Rd b/man/one_sample_test.Rd index fb0ce9fa..5d062ea6 100644 --- a/man/one_sample_test.Rd +++ b/man/one_sample_test.Rd @@ -131,13 +131,13 @@ one_sample_test(mtcars, wt, test.value = 3) # ----------------------- non-parametric ------------------- -one_sample_test(mtcars, wt, test.value = 3, type = "n") +one_sample_test(mtcars, wt, test.value = 3, type = "nonparametric") # ----------------------- robust --------------------------- -one_sample_test(mtcars, wt, test.value = 3, type = "r") +one_sample_test(mtcars, wt, test.value = 3, type = "robust") # ----------------------- Bayesian ------------------------- -one_sample_test(mtcars, wt, test.value = 3, type = "b") +one_sample_test(mtcars, wt, test.value = 3, type = "bayes") } diff --git a/man/two_sample_test.Rd b/man/two_sample_test.Rd index 636b8b81..decd8dee 100644 --- a/man/two_sample_test.Rd +++ b/man/two_sample_test.Rd @@ -178,88 +178,52 @@ The table below provides summary about: \examples{ \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{\}) # examplesIf} +# ----------------------- within-subjects ------------------------------------- + +# data +df <- dplyr::filter(bugs_long, condition \%in\% c("LDLF", "LDHF")) + # for reproducibility set.seed(123) -library(statsExpressions) -# parametric ------------------------------------- +# ----------------------- parametric --------------------------------------- -# between-subjects design -two_sample_test( - data = sleep, - x = group, - y = extra, - type = "p" -) +two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "parametric") -# within-subjects design -two_sample_test( - data = dplyr::filter(bugs_long, condition \%in\% c("HDHF", "HDLF")), - x = condition, - y = desire, - paired = TRUE, - subject.id = subject, - type = "p" -) +# ----------------------- non-parametric ----------------------------------- -# non-parametric ---------------------------------- +two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "nonparametric") -# between-subjects design -two_sample_test( - data = sleep, - x = group, - y = extra, - type = "np" -) +# ----------------------- robust -------------------------------------------- -# within-subjects design -two_sample_test( - data = dplyr::filter(bugs_long, condition \%in\% c("HDHF", "HDLF")), - x = condition, - y = desire, - paired = TRUE, - subject.id = subject, - type = "np" -) +two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "robust") -# robust ---------------------------------- +# ----------------------- Bayesian --------------------------------------- -# between-subjects design -two_sample_test( - data = sleep, - x = group, - y = extra, - type = "r" -) +two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "bayes") +# ----------------------- between-subjects ------------------------------------- -# within-subjects design -two_sample_test( - data = dplyr::filter(bugs_long, condition \%in\% c("HDHF", "HDLF")), - x = condition, - y = desire, - paired = TRUE, - subject.id = subject, - type = "r" -) +# for reproducibility +set.seed(123) -#' # Bayesian ------------------------------ +# ----------------------- parametric --------------------------------------- -# between-subjects design -two_sample_test( - data = sleep, - x = group, - y = extra, - type = "bayes" -) +# unequal variance +two_sample_test(ToothGrowth, supp, len, type = "parametric") -# within-subjects design -two_sample_test( - data = dplyr::filter(bugs_long, condition \%in\% c("HDHF", "HDLF")), - x = condition, - y = desire, - paired = TRUE, - subject.id = subject, - type = "bayes" -) -\dontshow{\}) # examplesIf} +# equal variance +two_sample_test(ToothGrowth, supp, len, type = "parametric", var.equal = TRUE) + +# ----------------------- non-parametric ----------------------------------- + +two_sample_test(ToothGrowth, supp, len, type = "nonparametric") + +# ----------------------- robust -------------------------------------------- + +two_sample_test(ToothGrowth, supp, len, type = "robust") + +# ----------------------- Bayesian --------------------------------------- + +two_sample_test(ToothGrowth, supp, len, type = "bayes") } diff --git a/vignettes/web_only/dataframe_outputs.Rmd b/vignettes/web_only/dataframe_outputs.Rmd index ea83d526..c3596b59 100644 --- a/vignettes/web_only/dataframe_outputs.Rmd +++ b/vignettes/web_only/dataframe_outputs.Rmd @@ -49,47 +49,6 @@ citation("statsExpressions") ```{r} #| label = "onesample", #| file = "../../man/examples/examples-one_sample_test.R" - -# ----------------------- parametric --------------------------------------- - -set.seed(123) -one_sample_test( - data = ggplot2::msleep, - x = brainwt, - test.value = 0.275, - type = "parametric" -) - -# ----------------------- non-parametric ----------------------------------- - -set.seed(123) -one_sample_test( - data = ggplot2::msleep, - x = brainwt, - test.value = 0.275, - type = "nonparametric" -) - -# ----------------------- robust -------------------------------------------- - -set.seed(123) -one_sample_test( - data = ggplot2::msleep, - x = brainwt, - test.value = 0.275, - type = "robust" -) - -# ----------------------- Bayesian --------------------------------------- - -set.seed(123) -one_sample_test( - data = ggplot2::msleep, - x = brainwt, - test.value = 0.275, - type = "bayes", - bf.prior = 0.8 -) ``` ## Two-sample tests @@ -98,114 +57,14 @@ one_sample_test( ```{r} #| label = "twosample_w" - -# data -df <- dplyr::filter(bugs_long, condition %in% c("LDLF", "LDHF")) - -# ----------------------- parametric --------------------------------------- - -set.seed(123) -two_sample_test( - data = df, - x = condition, - y = desire, - paired = TRUE, - subject.id = subject, - type = "p" -) - -# ----------------------- non-parametric ----------------------------------- - -set.seed(123) -two_sample_test( - data = df, - x = condition, - y = desire, - paired = TRUE, - subject.id = subject, - type = "np" -) - -# ----------------------- robust -------------------------------------------- - -set.seed(123) -two_sample_test( - data = df, - x = condition, - y = desire, - paired = TRUE, - subject.id = subject, - type = "r" -) - -# ----------------------- Bayesian --------------------------------------- - -set.seed(123) -two_sample_test( - data = df, - x = condition, - y = desire, - paired = TRUE, - subject.id = subject, - type = "bayes" -) +#| file = "../../man/examples/examples-two_sample_test_within.R" ``` ### between-subjects design ```{r} #| label = "twosample_b" - -# ----------------------- parametric --------------------------------------- - -# unequal variance -set.seed(123) -two_sample_test( - data = ToothGrowth, - x = supp, - y = len, - type = "p" -) - -# equal variance -set.seed(123) -two_sample_test( - data = ToothGrowth, - x = supp, - y = len, - var.equal = TRUE, - type = "p" -) - -# ----------------------- non-parametric ----------------------------------- - -set.seed(123) -two_sample_test( - data = ToothGrowth, - x = supp, - y = len, - type = "np" -) - -# ----------------------- robust -------------------------------------------- - -set.seed(123) -two_sample_test( - data = ToothGrowth, - x = supp, - y = len, - type = "r" -) - -# ----------------------- Bayesian --------------------------------------- - -set.seed(123) -two_sample_test( - data = ToothGrowth, - x = supp, - y = len, - type = "bayes" -) +#| file = "../../man/examples/examples-two_sample_test_between.R" ``` ## One-way ANOVAs From f90aa9e306c779d489b708ade843e07a34450369 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 12 Sep 2023 17:16:07 +0200 Subject: [PATCH 3/5] fix pkgdown --- vignettes/web_only/dataframe_outputs.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/web_only/dataframe_outputs.Rmd b/vignettes/web_only/dataframe_outputs.Rmd index c3596b59..9726438d 100644 --- a/vignettes/web_only/dataframe_outputs.Rmd +++ b/vignettes/web_only/dataframe_outputs.Rmd @@ -56,14 +56,14 @@ citation("statsExpressions") ### within-subjects design ```{r} -#| label = "twosample_w" +#| label = "twosample_w", #| file = "../../man/examples/examples-two_sample_test_within.R" ``` ### between-subjects design ```{r} -#| label = "twosample_b" +#| label = "twosample_b", #| file = "../../man/examples/examples-two_sample_test_between.R" ``` From 86be583243fca1f8224083a3ce6d5c087ec4111b Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 13 Sep 2023 19:53:34 +0200 Subject: [PATCH 4/5] return -> returns --- R/contingency_table.R | 2 +- R/corr_test.R | 2 +- R/long_to_wide_converter.R | 2 +- R/meta_analysis.R | 2 +- R/one_sample_test.R | 2 +- R/oneway_anova.R | 2 +- R/pairwise_comparisons.R | 4 ++-- R/two_sample_test.R | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/contingency_table.R b/R/contingency_table.R index 991bd945..bd7a1dfb 100644 --- a/R/contingency_table.R +++ b/R/contingency_table.R @@ -12,7 +12,7 @@ #' ```{r child="man/rmd-fragments/contingency_table.Rmd"} #' ``` #' -#' @return +#' @returns #' #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` diff --git a/R/corr_test.R b/R/corr_test.R index 50cb5b36..01fb0b13 100644 --- a/R/corr_test.R +++ b/R/corr_test.R @@ -12,7 +12,7 @@ #' ```{r child="man/rmd-fragments/corr_test.Rmd"} #' ``` #' -#' @return +#' @returns #' #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` diff --git a/R/long_to_wide_converter.R b/R/long_to_wide_converter.R index 7bfdf515..d3563bbf 100644 --- a/R/long_to_wide_converter.R +++ b/R/long_to_wide_converter.R @@ -34,7 +34,7 @@ #' converted from long/tidy to wide (default: `TRUE`). #' @param ... Currently ignored. #' -#' @return A data frame with `NA`s removed while respecting the +#' @returns A data frame with `NA`s removed while respecting the #' between-or-within-subjects nature of the dataset. #' #' @examples diff --git a/R/meta_analysis.R b/R/meta_analysis.R index 9d1faa76..657afed7 100644 --- a/R/meta_analysis.R +++ b/R/meta_analysis.R @@ -25,7 +25,7 @@ #' ```{r child="man/rmd-fragments/corr_test.Rmd"} #' ``` #' -#' @return +#' @returns #' #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` diff --git a/R/one_sample_test.R b/R/one_sample_test.R index f7949287..fb455aac 100644 --- a/R/one_sample_test.R +++ b/R/one_sample_test.R @@ -24,7 +24,7 @@ #' ```{r child="man/rmd-fragments/one_sample_test.Rmd"} #' ``` #' -#' @return +#' @returns #' #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` diff --git a/R/oneway_anova.R b/R/oneway_anova.R index fdba82a4..c31c7083 100644 --- a/R/oneway_anova.R +++ b/R/oneway_anova.R @@ -12,7 +12,7 @@ #' ```{r child="man/rmd-fragments/oneway_anova.Rmd"} #' ``` #' -#' @return +#' @returns #' #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` diff --git a/R/pairwise_comparisons.R b/R/pairwise_comparisons.R index b45a04b1..0559a176 100644 --- a/R/pairwise_comparisons.R +++ b/R/pairwise_comparisons.R @@ -24,7 +24,7 @@ #' ```{r child="man/rmd-fragments/pairwise_comparisons.Rmd"} #' ``` #' -#' @return +#' @returns #' #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` @@ -277,7 +277,7 @@ pairwise_comparisons <- function(data, #' @description #' Preparing text to describe which *p*-value adjustment method was used #' -#' @return Standardized text description for what method was used. +#' @returns Standardized text description for what method was used. #' #' @inheritParams pairwise_comparisons #' diff --git a/R/two_sample_test.R b/R/two_sample_test.R index 8786df79..330ea0e0 100644 --- a/R/two_sample_test.R +++ b/R/two_sample_test.R @@ -19,7 +19,7 @@ #' ```{r child="man/rmd-fragments/two_sample_test.Rmd"} #' ``` #' -#' @return +#' @returns #' #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` From de77bdc5653d18fb727f325820ed86ac2e0516f2 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Fri, 22 Sep 2023 22:27:54 +0530 Subject: [PATCH 5/5] Upkeep (#254) * remove date and author metadata from vignettes * bump to devel * update linter config * rename for effect size names * fix precommit workflow * use autoglobals tag * Update styler.yaml --- .Rbuildignore | 2 ++ .github/workflows/lint-changed-files.yaml | 1 + .github/workflows/lint.yaml | 3 ++ .github/workflows/styler.yaml | 1 + .lintr | 1 + CITATION.cff | 20 +++++------ DESCRIPTION | 15 +++++---- R/add_expression_col.R | 2 ++ R/centrality_description.R | 2 ++ R/contingency_table.R | 2 ++ R/corr_test.R | 2 ++ R/global_vars.R | 41 ----------------------- R/globals.R | 35 +++++++++++++++++++ R/helpers_easystats.R | 6 +++- R/long_to_wide_converter.R | 2 ++ R/meta_analysis.R | 2 ++ R/one_sample_test.R | 2 ++ R/oneway_anova.R | 2 ++ R/pairwise_comparisons.R | 2 ++ R/switch_functions.R | 2 ++ R/tidy_model_expressions.R | 2 ++ R/two_sample_test.R | 3 ++ WIP/gallery.Rmd | 2 -- codemeta.json | 14 ++++---- shell/metadata.sh | 11 ++++++ vignettes/statsExpressions.Rmd | 2 -- vignettes/stats_details.Rmd | 2 -- vignettes/web_only/dataframe_outputs.Rmd | 2 -- 28 files changed, 110 insertions(+), 73 deletions(-) delete mode 100644 R/global_vars.R create mode 100644 R/globals.R create mode 100644 shell/metadata.sh diff --git a/.Rbuildignore b/.Rbuildignore index 2668cdf3..fbf9447b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,6 +7,7 @@ ^CRAN-RELEASE$ ^CRAN-SUBMISSION$ ^LICENSE\.md$ +^Makefile$ ^Meta$ ^NEWS$ ^README-.*\.png$ @@ -48,4 +49,5 @@ hextools publication/* references.bib +shell tests\^spelling diff --git a/.github/workflows/lint-changed-files.yaml b/.github/workflows/lint-changed-files.yaml index d8b53464..c270947a 100644 --- a/.github/workflows/lint-changed-files.yaml +++ b/.github/workflows/lint-changed-files.yaml @@ -43,6 +43,7 @@ jobs: commented_code_linter = NULL, cyclocomp_linter(25L), extraction_operator_linter = NULL, + if_not_else_linter(exceptions = character(0L)), implicit_integer_linter = NULL, library_call_linter = NULL, line_length_linter(120L), diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 6e722645..5a137fdd 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -44,6 +44,7 @@ jobs: commented_code_linter = NULL, cyclocomp_linter(25L), extraction_operator_linter = NULL, + if_not_else_linter(exceptions = character(0L)), implicit_integer_linter = NULL, library_call_linter = NULL, line_length_linter(120L), @@ -62,3 +63,5 @@ jobs: defaults = linters_with_tags(tags = NULL) )) shell: Rscript {0} + env: + LINTR_ERROR_ON_LINT: true diff --git a/.github/workflows/styler.yaml b/.github/workflows/styler.yaml index 77cac5a9..1696fa17 100644 --- a/.github/workflows/styler.yaml +++ b/.github/workflows/styler.yaml @@ -30,6 +30,7 @@ jobs: r-lib/pkgapi r-lib/styler r-lib/roxygen2 + anthonynorth/roxyglobals needs: | styler roxygen2 diff --git a/.lintr b/.lintr index e3a82a21..843f5e62 100644 --- a/.lintr +++ b/.lintr @@ -4,6 +4,7 @@ linters: linters_with_defaults( commented_code_linter = NULL, cyclocomp_linter(25L), extraction_operator_linter = NULL, + if_not_else_linter(exceptions = character(0L)), implicit_integer_linter = NULL, library_call_linter = NULL, line_length_linter(120L), diff --git a/CITATION.cff b/CITATION.cff index 8c7df64b..3882b267 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "statsExpressions" in publications use:' type: software license: GPL-3.0-only title: 'statsExpressions: Tidy Dataframes and Expressions with Statistical Details' -version: 1.5.2 +version: 1.5.2.9000 doi: 10.21105/joss.03236 abstract: 'Utilities for producing dataframes with rich details for the most common types of statistical approaches and tests: parametric, nonparametric, robust, and @@ -110,7 +110,7 @@ references: given-names: Jeffrey N. email: jrouder@uci.edu year: '2023' - version: '>= 0.9.12-4.4' + version: '>= 0.9.12-4.5' - type: software title: correlation abstract: 'correlation: Methods for Correlation Analysis' @@ -149,7 +149,7 @@ references: abstract: 'datawizard: Easy Data Wrangling and Statistical Transformations' notes: Imports url: https://easystats.github.io/datawizard/ - repository: https://easystats.r-universe.dev + repository: https://CRAN.R-project.org/package=datawizard authors: - family-names: Patil given-names: Indrajeet @@ -176,7 +176,7 @@ references: email: brenton@wiernik.org orcid: https://orcid.org/0000-0001-9560-6336 year: '2023' - version: '>= 0.8.0' + version: '>= 0.9.0' - type: software title: dplyr abstract: 'dplyr: A Grammar of Data Manipulation' @@ -234,7 +234,7 @@ references: email: remi.theriault@mail.mcgill.ca orcid: https://orcid.org/0000-0003-4315-6788 year: '2023' - version: '>= 0.8.5' + version: '>= 0.8.6' - type: software title: glue abstract: 'glue: Interpreted String Literals' @@ -255,7 +255,7 @@ references: abstract: 'insight: Easy Access to Model Information for Various Model Objects' notes: Imports url: https://easystats.github.io/insight/ - repository: https://CRAN.R-project.org/package=insight + repository: https://easystats.r-universe.dev authors: - family-names: Lüdecke given-names: Daniel @@ -290,7 +290,7 @@ references: email: etienne.bacher@protonmail.com orcid: https://orcid.org/0000-0002-9271-5075 year: '2023' - version: '>= 0.19.4' + version: '>= 0.19.5' - type: software title: magrittr abstract: 'magrittr: A Forward-Pipe Operator for R' @@ -369,7 +369,7 @@ references: email: brenton@wiernik.org orcid: https://orcid.org/0000-0001-9560-6336 year: '2023' - version: '>= 0.10.4' + version: '>= 0.10.5' - type: software title: PMCMRplus abstract: 'PMCMRplus: Calculate Pairwise Multiple Comparisons of Mean Rank Sums @@ -589,12 +589,12 @@ references: title: metaBMA abstract: 'metaBMA: Bayesian Model Averaging for Random and Fixed Effects Meta-Analysis' notes: Suggests - url: https://github.com/danheck/metaBMA + url: https://danheck.github.io/metaBMA/ repository: https://CRAN.R-project.org/package=metaBMA authors: - family-names: Heck given-names: Daniel W. - email: dheck@uni-marburg.de + email: daniel.heck@uni-marburg.de orcid: https://orcid.org/0000-0002-6302-9252 year: '2023' - type: software diff --git a/DESCRIPTION b/DESCRIPTION index cbfa720b..4b2c7ff3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,13 +26,13 @@ Depends: R (>= 4.1.0) Imports: afex (>= 1.3-0), - BayesFactor (>= 0.9.12-4.4), + BayesFactor (>= 0.9.12-4.5), correlation (>= 0.8.4), - datawizard (>= 0.8.0), + datawizard (>= 0.9.0), dplyr (>= 1.1.3), - effectsize (>= 0.8.5), + effectsize (>= 0.8.6), glue, - insight (>= 0.19.4), + insight (>= 0.19.5), magrittr, parameters (>= 0.21.1), performance (>= 0.10.5), @@ -62,8 +62,11 @@ VignetteBuilder: Encoding: UTF-8 Language: en-US LazyData: true -Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace", "collate", - "pkgapi::api_roclet")) +Roxygen: list( + markdown = TRUE, + roclets = c("collate", "namespace", "rd", "pkgapi::api_roclet", "roxyglobals::global_roclet") + ) RoxygenNote: 7.2.3.9000 Config/testthat/edition: 3 Config/testthat/parallel: true +Config/Needs/check: anthonynorth/roxyglobals diff --git a/R/add_expression_col.R b/R/add_expression_col.R index 3ea05f1e..72d0b452 100644 --- a/R/add_expression_col.R +++ b/R/add_expression_col.R @@ -47,6 +47,8 @@ #' @inheritParams oneway_anova #' @inheritParams long_to_wide_converter #' +#' @autoglobal +#' #' @examples #' set.seed(123) #' diff --git a/R/centrality_description.R b/R/centrality_description.R index 2f2a4e65..573a9b76 100644 --- a/R/centrality_description.R +++ b/R/centrality_description.R @@ -24,6 +24,8 @@ #' @inheritParams oneway_anova #' @param ... Currently ignored. #' +#' @autoglobal +#' #' @example man/examples/examples-centrality_description.R #' @export centrality_description <- function(data, diff --git a/R/contingency_table.R b/R/contingency_table.R index bd7a1dfb..22debc7d 100644 --- a/R/contingency_table.R +++ b/R/contingency_table.R @@ -47,6 +47,8 @@ #' @inheritParams stats::chisq.test #' @inheritParams oneway_anova #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' # for reproducibility #' set.seed(123) diff --git a/R/corr_test.R b/R/corr_test.R index 01fb0b13..1ada7528 100644 --- a/R/corr_test.R +++ b/R/corr_test.R @@ -23,6 +23,8 @@ #' be plotted on the `y`-axis. #' @inheritParams oneway_anova #' +#' @autoglobal +#' #' @example man/examples/examples-corr_test.R #' @export corr_test <- function(data, diff --git a/R/global_vars.R b/R/global_vars.R deleted file mode 100644 index 9d4dfa5c..00000000 --- a/R/global_vars.R +++ /dev/null @@ -1,41 +0,0 @@ -# defining global variables and functions to appease R CMD Check - -utils::globalVariables( - names = c( - ".", - "effectsize", - "estimate", - ".rowid", - "statistic", - "std.error", - "term", - ".counts", - "nested_data", - "df", - "df.error", - "k.df", - "effsize.text", - "method", - ".f", - ".f.es", - ".f.args", - "bf10", - "conf.low", - "conf.high", - "r2.component", - "conf.level", - ".fn", - ".ns", - "p.value", - "where", - "k.df.error", - "group1", - "group2", - "log_e_bf10", - "p_adjust_text", - "n.obs", - "r.squared" - ), - package = "statsExpressions", - add = FALSE -) diff --git a/R/globals.R b/R/globals.R new file mode 100644 index 00000000..3605414c --- /dev/null +++ b/R/globals.R @@ -0,0 +1,35 @@ +# Generated by roxyglobals: do not edit by hand + +utils::globalVariables(c( + "method", # + "effectsize", # + "n.obs", # + "df", # + "n.obs", # + "estimate", # + ".counts", # + ".f", # + ".f.es", # + ".", # + "r.squared", # + ".", # + ".rowid", # + "nested_data", # + ".ns", # + ".fn", # + ".f.args", # + ".rowid", # + "k.df", # + "k.df.error", # + ".f", # + ".rowid", # + ".f", # + "group1", # + "group2", # + ".ns", # + ".fn", # + "term", # + "p.value", # + "term", # + NULL +)) diff --git a/R/helpers_easystats.R b/R/helpers_easystats.R index e89a0428..37e7a6db 100644 --- a/R/helpers_easystats.R +++ b/R/helpers_easystats.R @@ -3,6 +3,8 @@ #' #' @inheritParams parameters::model_parameters #' +#' @autoglobal +#' #' @examples #' model <- lm(mpg ~ wt + cyl, data = mtcars) #' tidy_model_parameters(model) @@ -12,7 +14,7 @@ tidy_model_parameters <- function(model, ...) { mutate(conf.method = . %@% "ci_method") %>% select(-matches("Difference")) %>% standardize_names(style = "broom") %>% - rename_all(~ gsub("cramers.", "", .x)) %>% + rename_all(~ gsub("cramers.|omega2.|eta2.", "", .x)) %>% rename_with(recode, bayes.factor = "bf10") %>% tidyr::fill(matches("^prior|^bf"), .direction = "updown") %>% mutate(across(matches("bf10"), ~ log(.x), .names = "log_e_{.col}")) @@ -46,6 +48,8 @@ tidy_model_parameters <- function(model, ...) { #' @param data A data frame returned by `{effectsize}` functions. #' @param ... Currently ignored. #' +#' @autoglobal +#' #' @examples #' df <- effectsize::cohens_d(sleep$extra, sleep$group) #' tidy_model_effectsize(df) diff --git a/R/long_to_wide_converter.R b/R/long_to_wide_converter.R index d3563bbf..968cebdb 100644 --- a/R/long_to_wide_converter.R +++ b/R/long_to_wide_converter.R @@ -37,6 +37,8 @@ #' @returns A data frame with `NA`s removed while respecting the #' between-or-within-subjects nature of the dataset. #' +#' @autoglobal +#' #' @examples #' # for reproducibility #' library(statsExpressions) diff --git a/R/meta_analysis.R b/R/meta_analysis.R index 657afed7..b9936707 100644 --- a/R/meta_analysis.R +++ b/R/meta_analysis.R @@ -36,6 +36,8 @@ #' needed package (`{metafor}`, `{metaplus}`, or `{metaBMA}`) for meta-analysis. #' If they are not available, you will be asked to install them. #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metafor", quietly = TRUE) #' # setup #' set.seed(123) diff --git a/R/one_sample_test.R b/R/one_sample_test.R index fb455aac..c2035121 100644 --- a/R/one_sample_test.R +++ b/R/one_sample_test.R @@ -29,6 +29,8 @@ #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` #' +#' @autoglobal +#' #' @example man/examples/examples-one_sample_test.R #' @export one_sample_test <- function(data, diff --git a/R/oneway_anova.R b/R/oneway_anova.R index c31c7083..945fa875 100644 --- a/R/oneway_anova.R +++ b/R/oneway_anova.R @@ -41,6 +41,8 @@ #' @param ... Additional arguments (currently ignored). #' @inheritParams stats::oneway.test #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' # for reproducibility #' set.seed(123) diff --git a/R/pairwise_comparisons.R b/R/pairwise_comparisons.R index 0559a176..74791b1d 100644 --- a/R/pairwise_comparisons.R +++ b/R/pairwise_comparisons.R @@ -32,6 +32,8 @@ #' @references For more, see: #' #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' # for reproducibility #' set.seed(123) diff --git a/R/switch_functions.R b/R/switch_functions.R index c98e534c..646ed57e 100644 --- a/R/switch_functions.R +++ b/R/switch_functions.R @@ -16,6 +16,8 @@ #' #' You can specify just the initial letter. #' +#' @autoglobal +#' #' @examples #' stats_type_switch("p") #' stats_type_switch("bf") diff --git a/R/tidy_model_expressions.R b/R/tidy_model_expressions.R index 3247d3bf..391fac6d 100644 --- a/R/tidy_model_expressions.R +++ b/R/tidy_model_expressions.R @@ -18,6 +18,8 @@ #' This is an **experimental** function and may change in the future. Please do #' not use it yet in your workflow. #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' # setup #' set.seed(123) diff --git a/R/two_sample_test.R b/R/two_sample_test.R index 330ea0e0..79947688 100644 --- a/R/two_sample_test.R +++ b/R/two_sample_test.R @@ -24,9 +24,12 @@ #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' @example man/examples/examples-two_sample_test_within.R #' @example man/examples/examples-two_sample_test_between.R +#' #' @export two_sample_test <- function(data, x, diff --git a/WIP/gallery.Rmd b/WIP/gallery.Rmd index 1cf088f8..37d098c4 100644 --- a/WIP/gallery.Rmd +++ b/WIP/gallery.Rmd @@ -1,7 +1,5 @@ --- title: "Gallery of examples" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: fig_width: 6 diff --git a/codemeta.json b/codemeta.json index e2c06175..71cb37ad 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/IndrajeetPatil/statsExpressions", "issueTracker": "https://github.com/IndrajeetPatil/statsExpressions/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "1.5.2", + "version": "1.5.2.9000", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -200,7 +200,7 @@ "@type": "SoftwareApplication", "identifier": "BayesFactor", "name": "BayesFactor", - "version": ">= 0.9.12-4.4", + "version": ">= 0.9.12-4.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -226,7 +226,7 @@ "@type": "SoftwareApplication", "identifier": "datawizard", "name": "datawizard", - "version": ">= 0.8.0", + "version": ">= 0.9.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -252,7 +252,7 @@ "@type": "SoftwareApplication", "identifier": "effectsize", "name": "effectsize", - "version": ">= 0.8.5", + "version": ">= 0.8.6", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -277,7 +277,7 @@ "@type": "SoftwareApplication", "identifier": "insight", "name": "insight", - "version": ">= 0.19.4", + "version": ">= 0.19.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -315,7 +315,7 @@ "@type": "SoftwareApplication", "identifier": "performance", "name": "performance", - "version": ">= 0.10.4", + "version": ">= 0.10.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -431,7 +431,7 @@ }, "SystemRequirements": null }, - "fileSize": "4130.563KB", + "fileSize": "4129.449KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/shell/metadata.sh b/shell/metadata.sh new file mode 100644 index 00000000..d15dfcc2 --- /dev/null +++ b/shell/metadata.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Update metadata for package +# +# To run on +# - mac: > sh .sh +# - windows: > bash .sh + +Rscript -e 'roxygen2::roxygenise()' +Rscript -e 'codemetar::write_codemeta()' +Rscript -e 'cffr::cff_write()' diff --git a/vignettes/statsExpressions.Rmd b/vignettes/statsExpressions.Rmd index 8fd5b39e..a2ef67d1 100644 --- a/vignettes/statsExpressions.Rmd +++ b/vignettes/statsExpressions.Rmd @@ -1,7 +1,5 @@ --- title: "statsExpressions: R Package for Tidy Dataframes and Expressions with Statistical Details" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/stats_details.Rmd b/vignettes/stats_details.Rmd index 6336ec43..be0df5db 100644 --- a/vignettes/stats_details.Rmd +++ b/vignettes/stats_details.Rmd @@ -1,7 +1,5 @@ --- title: "Test and effect size details" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/dataframe_outputs.Rmd b/vignettes/web_only/dataframe_outputs.Rmd index 9726438d..94b0bda5 100644 --- a/vignettes/web_only/dataframe_outputs.Rmd +++ b/vignettes/web_only/dataframe_outputs.Rmd @@ -1,7 +1,5 @@ --- title: "Data frame outputs" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true