From 789dc331c1f6223d7bbb16c5a340a1e0430dce8c Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 3 Dec 2024 15:50:47 +0100 Subject: [PATCH] RC CRAN 1.6.2: Fix tests for easystats update (#301) * Fix tests for insight update * Apply automatic changes * update package version * update workflow --------- Co-authored-by: IndrajeetPatil --- .github/workflows/R-CMD-check.yaml | 19 +------------- .github/workflows/pkgdown.yaml | 2 +- CITATION.cff | 4 +-- DESCRIPTION | 8 +++--- NEWS.md | 5 ++++ codemeta.json | 6 ++--- cran-comments.md | 2 +- man/meta_analysis.Rd | 8 +++--- man/oneway_anova.Rd | 4 +-- man/pairwise_comparisons.Rd | 2 +- man/tidy_model_expressions.Rd | 2 +- man/tidy_model_parameters.Rd | 26 +++++++++++-------- man/two_sample_test.Rd | 2 +- .../testthat/_snaps/tidy-model-expressions.md | 23 +++++++++------- tests/testthat/test-pairwise-comparisons.R | 1 - 15 files changed, 55 insertions(+), 59 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 386ff88c..85879236 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -25,25 +25,16 @@ jobs: #- {os: macOS-latest, r: 'devel'} - { os: macOS-latest, r: "release" } - { os: macOS-latest, r: "oldrel" } - #- {os: macOS-latest, r: 'oldrel-2'} - #- {os: macOS-latest, r: 'oldrel-3'} - #- { os: windows-latest, r: "next" } - { os: windows-latest, r: "devel" } - { os: windows-latest, r: "release" } - { os: windows-latest, r: "oldrel" } - #- {os: windows-latest, r: 'oldrel-2'} - #- {os: windows-latest, r: 'oldrel-3'} - - # use 4.1 to check with rtools40's older compiler - #- { os: windows-latest, r: "4.1" } #- { os: ubuntu-latest, r: "next" } - { os: ubuntu-latest, r: "devel" } - { os: ubuntu-latest, r: "release" } - { os: ubuntu-latest, r: "oldrel" } - # - { os: ubuntu-latest, r: "oldrel-2" } - # - { os: ubuntu-latest, r: "oldrel-3" } + #- { os: ubuntu-latest, r: "oldrel-2" } env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -67,16 +58,8 @@ jobs: upgrade: 'TRUE' extra-packages: | any::rcmdcheck - Matrix=?ignore-before-r=100.0.0 - lme4=?ignore-before-r=100.0.0 - TMB=?ignore-before-r=100.0.0 needs: check - - name: Install packages from source - run: | - utils::install.packages(c("Matrix", "lme4", "TMB"), type = "source") - shell: Rscript {0} - - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 11f910dd..eff5ad1d 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -48,7 +48,7 @@ jobs: - name: Deploy to GitHub pages 🚀 if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.6.9 + uses: JamesIves/github-pages-deploy-action@v4.7.1 with: branch: gh-pages folder: docs diff --git a/CITATION.cff b/CITATION.cff index 3d3edb51..62b850d5 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -348,7 +348,7 @@ references: orcid: https://orcid.org/0000-0002-9271-5075 year: '2024' doi: 10.32614/CRAN.package.insight - version: '>= 0.20.5' + version: '>= 1.0.0' - type: software title: magrittr abstract: 'magrittr: A Forward-Pipe Operator for R' @@ -397,7 +397,7 @@ references: orcid: https://orcid.org/0000-0001-9560-6336 year: '2024' doi: 10.32614/CRAN.package.parameters - version: '>= 0.23.0' + version: '>= 0.24.0' - type: software title: performance abstract: 'performance: Assessment of Regression Models Performance' diff --git a/DESCRIPTION b/DESCRIPTION index 31a46019..399f0e08 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: statsExpressions Title: Tidy Dataframes and Expressions with Statistical Details -Version: 1.6.1.9000 +Version: 1.6.2 Authors@R: person("Indrajeet", "Patil", , "patilindrajeet.science@gmail.com", role = c("cre", "aut", "cph"), comment = c(ORCID = "0000-0003-1995-6531")) @@ -20,7 +20,7 @@ URL: https://indrajeetpatil.github.io/statsExpressions/, https://github.com/IndrajeetPatil/statsExpressions BugReports: https://github.com/IndrajeetPatil/statsExpressions/issues Depends: - R (>= 4.1.0), + R (>= 4.3.0), stats Imports: afex (>= 1.4-1), @@ -31,9 +31,9 @@ Imports: dplyr (>= 1.1.4), effectsize (>= 0.8.9), glue (>= 1.8.0), - insight (>= 0.20.5), + insight (>= 1.0.0), magrittr (>= 2.0.3), - parameters (>= 0.23.0), + parameters (>= 0.24.0), performance (>= 0.12.4), PMCMRplus (>= 1.9.12), purrr (>= 1.0.2), diff --git a/NEWS.md b/NEWS.md index b0247f8b..12f3212e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# statsExpressions 1.6.2 + +- The minimum needed R version is now bumped to `R 4.3`. +- Fixes failing tests due to changes in `{easystats}` packages. + # statsExpressions 1.6.1 - Upgrade `{easystats}` package versions to avoid user-facing warnings due to diff --git a/codemeta.json b/codemeta.json index cf4c6422..4ff6de3c 100644 --- a/codemeta.json +++ b/codemeta.json @@ -285,7 +285,7 @@ "@type": "SoftwareApplication", "identifier": "insight", "name": "insight", - "version": ">= 0.20.5", + "version": ">= 1.0.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -311,7 +311,7 @@ "@type": "SoftwareApplication", "identifier": "parameters", "name": "parameters", - "version": ">= 0.23.0", + "version": ">= 0.24.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -439,7 +439,7 @@ }, "SystemRequirements": null }, - "fileSize": "4229.33KB", + "fileSize": "4229KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/cran-comments.md b/cran-comments.md index 5fe21fdf..0e3f95d3 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,7 +2,7 @@ 0 errors | 0 warnings | 0 note -* Fixes CRAN vignette build failures on R-oldrel. +* Fixes snapshot tests failing due to easystats updates. ## revdepcheck results diff --git a/man/meta_analysis.Rd b/man/meta_analysis.Rd index 6108ec65..083574a5 100644 --- a/man/meta_analysis.Rd +++ b/man/meta_analysis.Rd @@ -106,12 +106,12 @@ Patil, I., (2021). statsExpressions: R Package for Tidy Dataframes and Expressio } \examples{ -\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metafor", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metafor", quietly = TRUE)) withAutoprint(\{ # examplesIf} # setup set.seed(123) library(statsExpressions) \dontshow{\}) # examplesIf} -\dontshow{if (requireNamespace("metaplus", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (requireNamespace("metaplus", quietly = TRUE)) withAutoprint(\{ # examplesIf} # let's use `mag` dataset from `{metaplus}` data(mag, package = "metaplus") @@ -121,13 +121,13 @@ dat <- dplyr::rename(mag, estimate = yi, std.error = sei) 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} +\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metaplus", quietly = TRUE)) withAutoprint(\{ # examplesIf} # ----------------------- 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} +\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metaBMA", quietly = TRUE)) withAutoprint(\{ # examplesIf} # ----------------------- Bayesian ---------------------------------- diff --git a/man/oneway_anova.Rd b/man/oneway_anova.Rd index 9fc60adb..2a67c096 100644 --- a/man/oneway_anova.Rd +++ b/man/oneway_anova.Rd @@ -180,7 +180,7 @@ Patil, I., (2021). statsExpressions: R Package for Tidy Dataframes and Expressio } \examples{ -\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) withAutoprint(\{ # examplesIf} # for reproducibility set.seed(123) library(statsExpressions) @@ -243,7 +243,7 @@ oneway_anova( type = "r" ) \dontshow{\}) # examplesIf} -\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("rstantools")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("rstantools")) withAutoprint(\{ # examplesIf} # ----------------------- Bayesian ------------------------------------- diff --git a/man/pairwise_comparisons.Rd b/man/pairwise_comparisons.Rd index fa0faed1..1cb8b01d 100644 --- a/man/pairwise_comparisons.Rd +++ b/man/pairwise_comparisons.Rd @@ -163,7 +163,7 @@ Patil, I., (2021). statsExpressions: R Package for Tidy Dataframes and Expressio } \examples{ -\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) withAutoprint(\{ # examplesIf} # for reproducibility set.seed(123) library(statsExpressions) diff --git a/man/tidy_model_expressions.Rd b/man/tidy_model_expressions.Rd index bc4bbd3d..4e341944 100644 --- a/man/tidy_model_expressions.Rd +++ b/man/tidy_model_expressions.Rd @@ -45,7 +45,7 @@ Patil, I., (2021). statsExpressions: R Package for Tidy Dataframes and Expressio } \examples{ -\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) withAutoprint(\{ # examplesIf} # setup set.seed(123) library(statsExpressions) diff --git a/man/tidy_model_parameters.Rd b/man/tidy_model_parameters.Rd index ea4ccf06..4313b12a 100644 --- a/man/tidy_model_parameters.Rd +++ b/man/tidy_model_parameters.Rd @@ -10,17 +10,21 @@ tidy_model_parameters(model, ...) \item{model}{Statistical Model.} \item{...}{Arguments passed to or from other methods. Non-documented -arguments are \code{digits}, \code{p_digits}, \code{ci_digits} and \code{footer_digits} to set -the number of digits for the output. If \code{s_value = TRUE}, the p-value will -be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). -\code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). \code{groups} can be used to group -coefficients. It will be passed to the print-method, or can directly be used -in \code{print()}, see documentation in \code{\link[parameters:print.parameters_model]{print.parameters_model()}}. Furthermore, -see 'Examples' in \code{\link[parameters:model_parameters.default]{model_parameters.default()}}. For developers, whose -interest mainly is to get a "tidy" data frame of model summaries, it is -recommended to set \code{pretty_names = FALSE} to speed up computation of the -summary table.} +arguments are +\itemize{ +\item \code{digits}, \code{p_digits}, \code{ci_digits} and \code{footer_digits} to set the number of +digits for the output. \code{groups} can be used to group coefficients. These +arguments will be passed to the print-method, or can directly be used in +\code{print()}, see documentation in \code{\link[parameters:print.parameters_model]{print.parameters_model()}}. +\item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the +output (cf. \emph{Rafi and Greenland 2020}). +\item \code{pd} adds an additional column with the \emph{probability of direction} (see +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' in +\code{\link[parameters:model_parameters.default]{model_parameters.default()}}. +\item For developers, whose interest mainly is to get a "tidy" data frame of +model summaries, it is recommended to set \code{pretty_names = FALSE} to speed +up computation of the summary table. +}} } \description{ Convert \code{{parameters}} package output to \code{{tidyverse}} conventions diff --git a/man/two_sample_test.Rd b/man/two_sample_test.Rd index 676438c6..54e3bbf5 100644 --- a/man/two_sample_test.Rd +++ b/man/two_sample_test.Rd @@ -185,7 +185,7 @@ Patil, I., (2021). statsExpressions: R Package for Tidy Dataframes and Expressio } \examples{ -\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true")) withAutoprint(\{ # examplesIf} \dontshow{\}) # examplesIf} # ----------------------- within-subjects ------------------------------------- diff --git a/tests/testthat/_snaps/tidy-model-expressions.md b/tests/testthat/_snaps/tidy-model-expressions.md index 182ccd95..eaba1db2 100644 --- a/tests/testthat/_snaps/tidy-model-expressions.md +++ b/tests/testthat/_snaps/tidy-model-expressions.md @@ -60,15 +60,17 @@ Code select(df_chi, -expression) Output - # A tibble: 2 x 10 - term estimate std.error conf.level conf.low conf.high statistic df.error - - 1 age 0.0170 0.00923 0.95 -0.00106 0.0351 3.40 1 - 2 sex -0.512 0.168 0.95 -0.840 -0.183 9.31 1 - p.value conf.method - - 1 0.0650 Wald - 2 0.00228 Wald + # A tibble: 3 x 10 + term estimate std.error conf.level conf.low conf.high statistic + + 1 age 0.0170 0.00923 0.95 -0.00106 0.0351 3.40 + 2 sex -0.512 0.168 0.95 -0.840 -0.183 9.31 + 3 frailty(inst) NA NA 0.95 NA NA 0.0000605 + df.error p.value conf.method + + 1 1 0.0650 Wald + 2 1 0.00228 Wald + 3 1 0.994 Wald --- @@ -83,6 +85,9 @@ list(widehat(italic(beta)) == "-0.51", italic(chi)^2 * ("1") == "9.31", italic(p) == "2.28e-03") + [[3]] + NULL + # tidy_model_expressions works - z diff --git a/tests/testthat/test-pairwise-comparisons.R b/tests/testthat/test-pairwise-comparisons.R index 2160d70e..764248a8 100644 --- a/tests/testthat/test-pairwise-comparisons.R +++ b/tests/testthat/test-pairwise-comparisons.R @@ -213,7 +213,6 @@ test_that( ) - # within-subjects design - no NAs ----------------------------------------- test_that(