From 484c4e66546562607ffcb554a22035b1614dd992 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Fri, 15 Sep 2023 12:16:40 +0200 Subject: [PATCH] update metaBMA tests; standardize vignette metadat --- CITATION.cff | 16 +- DESCRIPTION | 6 +- NEWS.md | 4 +- R/ggbetweenstats_helpers.R | 6 +- R/ggpiestats_ggbarstats_helpers.R | 2 +- R/globals.R | 2 + codemeta.json | 10 +- cran-comments.md | 2 +- old/benchmarking.Rmd | 26 +- old/combine_plots.Rmd | 8 - old/dependencies.Rmd | 7 - old/ggcoefstats_old.Rmd | 9 - old/purrr_examples.Rmd | 8 - tests/testthat.R | 2 +- .../ggcoefstats/meta-analysis-works.svg | 6 +- .../pairwise_ggsignif/between-bayes.svg | 427 +++++++----------- tests/testthat/test-pairwise_ggsignif.R | 2 +- vignettes/additional.Rmd | 2 - vignettes/ggstatsplot.Rmd | 2 - vignettes/web_only/faq.Rmd | 2 - vignettes/web_only/ggbarstats.Rmd | 2 - vignettes/web_only/ggbetweenstats.Rmd | 2 - vignettes/web_only/ggcoefstats.Rmd | 2 - vignettes/web_only/ggcorrmat.Rmd | 2 - vignettes/web_only/ggdotplotstats.Rmd | 2 - vignettes/web_only/gghistostats.Rmd | 8 - vignettes/web_only/ggpiestats.Rmd | 2 - vignettes/web_only/ggscatterstats.Rmd | 2 - vignettes/web_only/ggwithinstats.Rmd | 2 - vignettes/web_only/pairwise.Rmd | 2 - vignettes/web_only/principles.Rmd | 2 - vignettes/web_only/purrr_examples.Rmd | 2 - 32 files changed, 184 insertions(+), 395 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 9f9a620dd..d570901a4 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "ggstatsplot" in publications use:' type: software license: GPL-3.0-only title: 'ggstatsplot: ''ggplot2'' Based Plots with Statistical Details' -version: 0.12.0.9000 +version: 0.12.1 doi: 10.21105/joss.03167 abstract: 'Extension of ''ggplot2'', ''ggstatsplot'' creates graphics with details from statistical tests included in the plots themselves. It provides an easier syntax @@ -110,7 +110,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 @@ -137,7 +137,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' @@ -309,7 +309,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: paletteer abstract: 'paletteer: Comprehensive Collection of Color Palettes' @@ -369,7 +369,7 @@ references: abstract: 'performance: Assessment of Regression Models Performance' notes: Imports url: https://easystats.github.io/performance/ - repository: https://CRAN.R-project.org/package=performance + repository: https://easystats.r-universe.dev authors: - family-names: Lüdecke given-names: Daniel @@ -449,8 +449,8 @@ references: given-names: Indrajeet email: patilindrajeet.science@gmail.com orcid: https://orcid.org/0000-0003-1995-6531 - year: '2023' version: '>= 1.5.2' + year: '2023' - type: software title: tidyr abstract: 'tidyr: Tidy Messy Data' @@ -574,12 +574,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 9072b8dce..fb27a330a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: ggstatsplot Title: 'ggplot2' Based Plots with Statistical Details -Version: 0.12.0.9000 +Version: 0.12.1 Authors@R: c(person(given = "Indrajeet", family = "Patil", @@ -32,7 +32,7 @@ Depends: R (>= 4.1.0) Imports: correlation (>= 0.8.4), - datawizard (>= 0.8.0), + datawizard (>= 0.9.0), dplyr (>= 1.1.3), ggcorrplot (>= 0.1.4.1), ggplot2 (>= 3.4.3), @@ -40,7 +40,7 @@ Imports: ggside (>= 0.2.2), ggsignif (>= 0.6.4), glue, - insight (>= 0.19.4), + insight (>= 0.19.5), paletteer, parameters (>= 0.21.1), patchwork, diff --git a/NEWS.md b/NEWS.md index f7f5985ed..eed3a9a8f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,12 @@ -# ggstatsplot 0.12.0.9000 +# ggstatsplot 0.12.1 N.B. All statistical analysis in `{ggstatsplot}` is carried out in `{statsExpressions}`. Thus, to see changes related to statistical expressions, read the `NEWS` for that package: +- No user-visible changes. Maintenance-only release. + # ggstatsplot 0.12.0 ## BREAKING CHANGES diff --git a/R/ggbetweenstats_helpers.R b/R/ggbetweenstats_helpers.R index ead8406a1..0eda18c5c 100644 --- a/R/ggbetweenstats_helpers.R +++ b/R/ggbetweenstats_helpers.R @@ -201,9 +201,9 @@ # which comparisons were displayed? display <- case_when( - substr(pairwise.display, 1L, 1L) == "s" ~ "significant", - substr(pairwise.display, 1L, 1L) == "n" ~ "non-significant", - TRUE ~ "all" + startsWith(pairwise.display, "s") ~ "significant", + startsWith(pairwise.display, "n") ~ "non-significant", + .default = "all" ) parse(text = glue("list('Pairwise test:'~bold('{test}'), 'Bars shown:'~bold('{display}'))")) diff --git a/R/ggpiestats_ggbarstats_helpers.R b/R/ggpiestats_ggbarstats_helpers.R index c9b62b4a3..ce52ce6ac 100644 --- a/R/ggpiestats_ggbarstats_helpers.R +++ b/R/ggpiestats_ggbarstats_helpers.R @@ -12,7 +12,7 @@ descriptive_data <- function(data, .label = case_when( grepl("perc|prop", label.content) ~ paste0(round(perc, perc.k), "%"), grepl("count|n|N", label.content) ~ .prettyNum(counts), - TRUE ~ paste0(.prettyNum(counts), "\n", "(", round(perc, perc.k), "%)") + .default = paste0(.prettyNum(counts), "\n", "(", round(perc, perc.k), "%)") ) ) %>% # reorder the category factor levels to order the legend mutate({{ x }} := factor({{ x }}, unique({{ x }}))) diff --git a/R/globals.R b/R/globals.R index bc07fee41..5617b1ce7 100644 --- a/R/globals.R +++ b/R/globals.R @@ -19,6 +19,8 @@ utils::globalVariables(c( ".counts", # "perc", # ".label", # + "counts", # + "perc", # "counts", # <.cat_counter> "counts", # ".", # diff --git a/codemeta.json b/codemeta.json index 65497725f..2dab02bbb 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/IndrajeetPatil/ggstatsplot", "issueTracker": "https://github.com/IndrajeetPatil/ggstatsplot/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.12.0.9000", + "version": "0.12.1", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -291,7 +291,7 @@ "@type": "SoftwareApplication", "identifier": "datawizard", "name": "datawizard", - "version": ">= 0.8.0", + "version": ">= 0.9.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -394,7 +394,7 @@ "@type": "SoftwareApplication", "identifier": "insight", "name": "insight", - "version": ">= 0.19.4", + "version": ">= 0.19.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -457,7 +457,7 @@ "@type": "SoftwareApplication", "identifier": "purrr", "name": "purrr", - "version": ">= 1.0.2", + "version": ">= 1.0.3", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -515,7 +515,7 @@ }, "SystemRequirements": null }, - "fileSize": "9407.077KB", + "fileSize": "9389.231KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/cran-comments.md b/cran-comments.md index 5f724bbe4..53af350de 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,7 +2,7 @@ 0 errors | 0 warnings | 0 note -- Maintenance release. +- No user-visible changes. Maintenance-only release. ## revdepcheck results diff --git a/old/benchmarking.Rmd b/old/benchmarking.Rmd index b92f8d01e..174626ce1 100644 --- a/old/benchmarking.Rmd +++ b/old/benchmarking.Rmd @@ -1,38 +1,14 @@ --- title: "Benchmarking" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_document: - fig_width: 6 - fig.align: 'center' - fig.asp: 0.618 - dpi: 300 toc: true - toc_depth: 3 - warning: FALSE - message: FALSE --- ```{r} #| label = "setup", #| include = FALSE -options( - tibble.width = Inf, - pillar.bold = TRUE, - pillar.neg = TRUE, - pillar.subtle_num = TRUE, - pillar.min_chars = Inf -) - -knitr::opts_chunk$set( - collapse = TRUE, - dpi = 300, - out.width = "100%", - comment = "#>", - warning = FALSE, - message = FALSE -) +source("../setup.R") ``` # Introduction diff --git a/old/combine_plots.Rmd b/old/combine_plots.Rmd index f6b4d2ca8..23d6f15db 100644 --- a/old/combine_plots.Rmd +++ b/old/combine_plots.Rmd @@ -1,16 +1,8 @@ --- title: "combine_plots" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: - fig_width: 6 - fig.align: 'center' - fig.asp: 0.618 - dpi: 300 toc: true - warning: FALSE - message: FALSE vignette: > %\VignetteIndexEntry{combine_plots} %\VignetteEngine{knitr::rmarkdown} diff --git a/old/dependencies.Rmd b/old/dependencies.Rmd index 33b2a4468..96c0e010d 100644 --- a/old/dependencies.Rmd +++ b/old/dependencies.Rmd @@ -4,14 +4,7 @@ author: "Indrajeet Patil" date: "`r Sys.Date()`" output: rmarkdown::html_document: - fig_width: 6 - fig.align: 'center' - fig.asp: 0.618 - dpi: 300 toc: true - toc_depth: 3 - warning: FALSE - message: FALSE --- ```{r} diff --git a/old/ggcoefstats_old.Rmd b/old/ggcoefstats_old.Rmd index 27203bfe6..b91e218f3 100644 --- a/old/ggcoefstats_old.Rmd +++ b/old/ggcoefstats_old.Rmd @@ -1,17 +1,8 @@ --- title: "ggcoefstats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: - fig_width: 6 - fig.align: 'center' - fig.asp: 0.618 - dpi: 300 toc: true - warning: FALSE - message: FALSE - error: TRUE vignette: > %\VignetteIndexEntry{ggcoefstats} %\VignetteEngine{knitr::rmarkdown} diff --git a/old/purrr_examples.Rmd b/old/purrr_examples.Rmd index bb57ce870..695136e53 100644 --- a/old/purrr_examples.Rmd +++ b/old/purrr_examples.Rmd @@ -1,16 +1,8 @@ --- title: "using `{ggstatsplot}` with the `{purrr}` package" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_document: - fig_width: 6 - fig.align: 'center' - fig.asp: 0.618 - dpi: 300 toc: true - warning: FALSE - message: FALSE --- ```{r} diff --git a/tests/testthat.R b/tests/testthat.R index 019ff18ff..408de2884 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,6 +1,6 @@ # graphics engine changed in this version, and so snapshots generated on # previous R version won't work -if (getRversion() > "4.1.0" && getRversion() < "4.4.0") { +if (getRversion() < "4.4.0") { library(testthat) suppressPackageStartupMessages(library(ggstatsplot)) diff --git a/tests/testthat/_snaps/ggcoefstats/meta-analysis-works.svg b/tests/testthat/_snaps/ggcoefstats/meta-analysis-works.svg index 7932e75df..66b5b55a2 100644 --- a/tests/testthat/_snaps/ggcoefstats/meta-analysis-works.svg +++ b/tests/testthat/_snaps/ggcoefstats/meta-analysis-works.svg @@ -120,7 +120,7 @@ difference posterior = -0.39 +0.38 , C @@ -131,10 +131,10 @@ I [ --0.02 +-0.05 , -0.81 +0.79 ] , diff --git a/tests/testthat/_snaps/pairwise_ggsignif/between-bayes.svg b/tests/testthat/_snaps/pairwise_ggsignif/between-bayes.svg index 589e8c68e..15e000e69 100644 --- a/tests/testthat/_snaps/pairwise_ggsignif/between-bayes.svg +++ b/tests/testthat/_snaps/pairwise_ggsignif/between-bayes.svg @@ -21,285 +21,162 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -μ - -M -A -P -= -5.021 - -μ - -M -A -P -= -5.748 - -μ - -M -A -P -= -6.399 -l -o -g -e -( -B -F -01 -) -= --33.669 - - - -l -o -g -e -( -B -F -01 -) -= --56.343 - - - -l -o -g -e -( -B -F -01 -) -= --11.162 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +μ + +M +A +P += +23.135 + +μ + +M +A +P += +20.890 + +μ + +M +A +P += +15.191 +l +o +g +e +( +B +F +01 +) += +-3.179 + + + +l +o +g +e +( +B +F +01 +) += +-12.383 + + + +l +o +g +e +( +B +F +01 +) += +-4.358 + + + -5 -6 -7 -8 -9 - - - - - - - - -setosa -(n = 50) -versicolor -(n = 50) -virginica -(n = 50) -Species -Sepal.Length +10 +20 +30 +40 + + + + + + + +4 +(n = 11) +6 +(n = 7) +8 +(n = 14) +cyl +mpg Pairwise test: Student's t diff --git a/tests/testthat/test-pairwise_ggsignif.R b/tests/testthat/test-pairwise_ggsignif.R index 2d1a92333..07db227a1 100644 --- a/tests/testthat/test-pairwise_ggsignif.R +++ b/tests/testthat/test-pairwise_ggsignif.R @@ -116,7 +116,7 @@ test_that( set.seed(123) expect_doppelganger( title = "between - bayes", - fig = ggbetweenstats(iris, Species, Sepal.Length, + fig = ggbetweenstats(mtcars, cyl, mpg, type = "bayes", results.subtitle = FALSE, k = 3L diff --git a/vignettes/additional.Rmd b/vignettes/additional.Rmd index b52adeb70..9ac12cdba 100644 --- a/vignettes/additional.Rmd +++ b/vignettes/additional.Rmd @@ -1,7 +1,5 @@ --- title: "Additional vignettes" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/ggstatsplot.Rmd b/vignettes/ggstatsplot.Rmd index c23415cca..729115105 100644 --- a/vignettes/ggstatsplot.Rmd +++ b/vignettes/ggstatsplot.Rmd @@ -1,7 +1,5 @@ --- title: "Visualizations with statistical details: The 'ggstatsplot' approach" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/faq.Rmd b/vignettes/web_only/faq.Rmd index 3bbf20a38..6918a5a8d 100644 --- a/vignettes/web_only/faq.Rmd +++ b/vignettes/web_only/faq.Rmd @@ -1,7 +1,5 @@ --- title: "Frequently Asked Questions (FAQ)" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/ggbarstats.Rmd b/vignettes/web_only/ggbarstats.Rmd index ef966c11f..78f194f7c 100644 --- a/vignettes/web_only/ggbarstats.Rmd +++ b/vignettes/web_only/ggbarstats.Rmd @@ -1,7 +1,5 @@ --- title: "ggbarstats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/ggbetweenstats.Rmd b/vignettes/web_only/ggbetweenstats.Rmd index 028123748..663b6871d 100644 --- a/vignettes/web_only/ggbetweenstats.Rmd +++ b/vignettes/web_only/ggbetweenstats.Rmd @@ -1,7 +1,5 @@ --- title: "ggbetweenstats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/ggcoefstats.Rmd b/vignettes/web_only/ggcoefstats.Rmd index c271d032b..ed4851efb 100644 --- a/vignettes/web_only/ggcoefstats.Rmd +++ b/vignettes/web_only/ggcoefstats.Rmd @@ -1,7 +1,5 @@ --- title: "ggcoefstats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/ggcorrmat.Rmd b/vignettes/web_only/ggcorrmat.Rmd index 87971d0d0..4f36cb15e 100644 --- a/vignettes/web_only/ggcorrmat.Rmd +++ b/vignettes/web_only/ggcorrmat.Rmd @@ -1,7 +1,5 @@ --- title: "ggcorrmat" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/ggdotplotstats.Rmd b/vignettes/web_only/ggdotplotstats.Rmd index 1201e1da3..4ffe882e9 100644 --- a/vignettes/web_only/ggdotplotstats.Rmd +++ b/vignettes/web_only/ggdotplotstats.Rmd @@ -1,7 +1,5 @@ --- title: "ggdotplotstats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/gghistostats.Rmd b/vignettes/web_only/gghistostats.Rmd index 5b31984f5..235f543fa 100644 --- a/vignettes/web_only/gghistostats.Rmd +++ b/vignettes/web_only/gghistostats.Rmd @@ -1,16 +1,8 @@ --- title: "gghistostats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: - fig_width: 6 - fig.align: 'center' - fig.asp: 0.618 - dpi: 300 toc: true - warning: FALSE - message: FALSE vignette: > %\VignetteIndexEntry{gghistostats} %\VignetteEngine{knitr::rmarkdown} diff --git a/vignettes/web_only/ggpiestats.Rmd b/vignettes/web_only/ggpiestats.Rmd index 98dc0ce25..c80253a7c 100644 --- a/vignettes/web_only/ggpiestats.Rmd +++ b/vignettes/web_only/ggpiestats.Rmd @@ -1,7 +1,5 @@ --- title: "ggpiestats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/ggscatterstats.Rmd b/vignettes/web_only/ggscatterstats.Rmd index c77f85691..765c5c50e 100644 --- a/vignettes/web_only/ggscatterstats.Rmd +++ b/vignettes/web_only/ggscatterstats.Rmd @@ -1,7 +1,5 @@ --- title: "ggscatterstats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/ggwithinstats.Rmd b/vignettes/web_only/ggwithinstats.Rmd index a06a1823f..6c77ac608 100644 --- a/vignettes/web_only/ggwithinstats.Rmd +++ b/vignettes/web_only/ggwithinstats.Rmd @@ -1,7 +1,5 @@ --- title: "ggwithinstats" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/pairwise.Rmd b/vignettes/web_only/pairwise.Rmd index 0aa6b711a..a7662e793 100644 --- a/vignettes/web_only/pairwise.Rmd +++ b/vignettes/web_only/pairwise.Rmd @@ -1,7 +1,5 @@ --- title: "Pairwise comparisons with `{ggstatsplot}`" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/principles.Rmd b/vignettes/web_only/principles.Rmd index 70186d3fb..547c70626 100644 --- a/vignettes/web_only/principles.Rmd +++ b/vignettes/web_only/principles.Rmd @@ -1,7 +1,5 @@ --- title: "Graphic design and statistical reporting principles" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/purrr_examples.Rmd b/vignettes/web_only/purrr_examples.Rmd index 1c21b8668..63925c917 100644 --- a/vignettes/web_only/purrr_examples.Rmd +++ b/vignettes/web_only/purrr_examples.Rmd @@ -1,7 +1,5 @@ --- title: "Using '{ggstatsplot}' with the '{purrr}' package" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true