Skip to content

Commit 6c163ff

Browse files
Merge branch 'main' into fail-on-lints
2 parents f56b1b6 + a9fad99 commit 6c163ff

18 files changed

+332
-380
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
- name: Deploy to GitHub pages 🚀
5050
if: github.event_name != 'pull_request'
51-
uses: JamesIves/[email protected].1
51+
uses: JamesIves/[email protected].3
5252
with:
5353
branch: gh-pages
5454
folder: docs

CITATION.cff

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ message: 'To cite package "ggstatsplot" in publications use:'
88
type: software
99
license: GPL-3.0-only
1010
title: 'ggstatsplot: ''ggplot2'' Based Plots with Statistical Details'
11-
version: 0.12.3.9000
11+
version: 0.12.4.9000
1212
doi: 10.21105/joss.03167
1313
abstract: 'Extension of ''ggplot2'', ''ggstatsplot'' creates graphics with details
1414
from statistical tests included in the plots themselves. It provides an easier syntax
@@ -76,7 +76,7 @@ references:
7676
abstract: 'correlation: Methods for Correlation Analysis'
7777
notes: Imports
7878
url: https://easystats.github.io/correlation/
79-
repository: https://easystats.r-universe.dev
79+
repository: https://CRAN.R-project.org/package=correlation
8080
authors:
8181
- family-names: Makowski
8282
given-names: Dominique
@@ -103,13 +103,13 @@ references:
103103
104104
orcid: https://orcid.org/0000-0003-4315-6788
105105
year: '2024'
106-
version: '>= 0.8.4'
106+
version: '>= 0.8.5'
107107
- type: software
108108
title: datawizard
109109
abstract: 'datawizard: Easy Data Wrangling and Statistical Transformations'
110110
notes: Imports
111111
url: https://easystats.github.io/datawizard/
112-
repository: https://CRAN.R-project.org/package=datawizard
112+
repository: https://easystats.r-universe.dev
113113
authors:
114114
- family-names: Patil
115115
given-names: Indrajeet
@@ -136,7 +136,7 @@ references:
136136
137137
orcid: https://orcid.org/0000-0001-9560-6336
138138
year: '2024'
139-
version: '>= 0.10.0'
139+
version: '>= 0.11.0'
140140
- type: software
141141
title: dplyr
142142
abstract: 'dplyr: A Grammar of Data Manipulation'
@@ -313,7 +313,7 @@ references:
313313
314314
orcid: https://orcid.org/0000-0002-9271-5075
315315
year: '2024'
316-
version: '>= 0.19.11'
316+
version: '>= 0.20.1'
317317
- type: software
318318
title: paletteer
319319
abstract: 'paletteer: Comprehensive Collection of Color Palettes'
@@ -356,7 +356,7 @@ references:
356356
357357
orcid: https://orcid.org/0000-0001-9560-6336
358358
year: '2024'
359-
version: '>= 0.21.7'
359+
version: '>= 0.22.0'
360360
- type: software
361361
title: patchwork
362362
abstract: 'patchwork: The Composer of Plots'
@@ -375,7 +375,7 @@ references:
375375
abstract: 'performance: Assessment of Regression Models Performance'
376376
notes: Imports
377377
url: https://easystats.github.io/performance/
378-
repository: https://CRAN.R-project.org/package=performance
378+
repository: https://easystats.r-universe.dev
379379
authors:
380380
- family-names: Lüdecke
381381
given-names: Daniel
@@ -406,7 +406,7 @@ references:
406406
407407
orcid: https://orcid.org/0000-0003-4315-6788
408408
year: '2024'
409-
version: '>= 0.11.0'
409+
version: '>= 0.12.0'
410410
- type: software
411411
title: purrr
412412
abstract: 'purrr: Functional Programming Tools'
@@ -437,17 +437,7 @@ references:
437437
given-names: Hadley
438438
439439
year: '2024'
440-
version: '>= 1.1.3'
441-
- type: software
442-
title: stats
443-
abstract: 'R: A Language and Environment for Statistical Computing'
444-
notes: Imports
445-
authors:
446-
- name: R Core Team
447-
institution:
448-
name: R Foundation for Statistical Computing
449-
address: Vienna, Austria
450-
year: '2024'
440+
version: '>= 1.1.4'
451441
- type: software
452442
title: statsExpressions
453443
abstract: 'statsExpressions: Tidy Dataframes and Expressions with Statistical Details'
@@ -459,8 +449,8 @@ references:
459449
given-names: Indrajeet
460450
461451
orcid: https://orcid.org/0000-0003-1995-6531
452+
version: '>= 1.5.5'
462453
year: '2024'
463-
version: '>= 1.5.4'
464454
- type: software
465455
title: tidyr
466456
abstract: 'tidyr: Tidy Messy Data'
@@ -580,6 +570,8 @@ references:
580570
- family-names: Ripley
581571
given-names: Brian
582572
573+
- family-names: Venables
574+
given-names: Bill
583575
year: '2024'
584576
- type: software
585577
title: metaBMA
@@ -620,7 +612,7 @@ references:
620612
authors:
621613
- family-names: Beath
622614
given-names: Ken
623-
email: ken@kjbeath.com.au
615+
email: ken@kjbeath.id.au
624616
- family-names: Bolker
625617
given-names: Ben
626618
@@ -638,6 +630,9 @@ references:
638630
639631
orcid: https://orcid.org/0000-0003-4880-9610
640632
year: '2024'
633+
identifiers:
634+
- type: url
635+
value: https://personality-project.org/r/psych-manual.pdf
641636
- type: software
642637
title: rmarkdown
643638
abstract: 'rmarkdown: Dynamic Documents for R'
@@ -700,6 +695,16 @@ references:
700695
- family-names: Johnson
701696
given-names: Andrew
702697
year: '2024'
698+
- type: software
699+
title: stats
700+
abstract: 'R: A Language and Environment for Statistical Computing'
701+
notes: Suggests
702+
authors:
703+
- name: R Core Team
704+
institution:
705+
name: R Foundation for Statistical Computing
706+
address: Vienna, Austria
707+
year: '2024'
703708
- type: software
704709
title: survival
705710
abstract: 'survival: Survival Analysis'

DESCRIPTION

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: ggstatsplot
33
Title: 'ggplot2' Based Plots with Statistical Details
4-
Version: 0.12.3.9000
4+
Version: 0.12.4.9000
55
Authors@R:
66
c(person(given = "Indrajeet",
77
family = "Patil",
@@ -31,24 +31,23 @@ BugReports: https://github.com/IndrajeetPatil/ggstatsplot/issues
3131
Depends:
3232
R (>= 4.1.0)
3333
Imports:
34-
correlation (>= 0.8.4),
35-
datawizard (>= 0.10.0),
34+
correlation (>= 0.8.5),
35+
datawizard (>= 0.11.0),
3636
dplyr (>= 1.1.4),
3737
ggcorrplot (>= 0.1.4.1),
3838
ggplot2 (>= 3.5.1),
3939
ggrepel (>= 0.9.5),
4040
ggside (>= 0.3.1),
4141
ggsignif (>= 0.6.4),
4242
glue (>= 1.7.0),
43-
insight (>= 0.19.11),
43+
insight (>= 0.20.1),
4444
paletteer (>= 1.6.0),
45-
parameters (>= 0.21.7),
45+
parameters (>= 0.22.0),
4646
patchwork (>= 1.2.0),
47-
performance (>= 0.11.0),
47+
performance (>= 0.12.0),
4848
purrr (>= 1.0.2),
49-
rlang (>= 1.1.3),
50-
stats,
51-
statsExpressions (>= 1.5.4),
49+
rlang (>= 1.1.4),
50+
statsExpressions (>= 1.5.5),
5251
tidyr (>= 1.3.1),
5352
utils
5453
Suggests:
@@ -64,6 +63,7 @@ Suggests:
6463
psych,
6564
rmarkdown,
6665
rstantools,
66+
stats,
6767
survival,
6868
testthat (>= 3.2.1),
6969
tibble,
@@ -79,7 +79,7 @@ Roxygen: list(
7979
markdown = TRUE,
8080
roclets = c("collate", "namespace", "rd", "pkgapi::api_roclet", "roxyglobals::global_roclet")
8181
)
82-
RoxygenNote: 7.3.1
82+
RoxygenNote: 7.3.2
8383
Config/testthat/edition: 3
8484
Config/testthat/parallel: true
8585
Config/Needs/check: anthonynorth/roxyglobals

NEWS.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
1-
# ggstatsplot 0.12.3.9000
1+
# ggstatsplot 0.12.4.9000
22

33
N.B. All statistical analysis in `{ggstatsplot}` is carried out in
44
`{statsExpressions}`. Thus, to see changes related to statistical expressions,
55
read the `NEWS` for that package:
66
<https://indrajeetpatil.github.io/statsExpressions/news/index.html>
77

8+
## BUG FIXES
9+
10+
- `ggpiestats()` and `ggbarstats()` now respect `ratio()` argument for
11+
proportion tests run in case of two-way contingency tables (#818).
12+
13+
# ggstatsplot 0.12.4
14+
815
## MAJOR CHANGES
916

10-
- The feature to superimpose normality curve on a histogram (in `gghistostats()`) has been removed.
11-
This feature always felt like an ad hoc addition to the plot, and has nothing to do with the key
12-
statistical analysis in question (which is not about checking the normality of the distribution).
17+
- The feature to superimpose normality curve on a histogram (in
18+
`gghistostats()`) has been removed. This feature always felt like an ad hoc
19+
addition to the plot, and has nothing to do with the key statistical analysis
20+
in question (which is not about checking the normality of the distribution).
21+
22+
## MINOR CHANGES
23+
24+
- Updates code to fix warnings coming via updates to easystats packages.
1325

1426
## BUG FIXES
1527

16-
- Empty groups in factors are no longer dropped in `ggpiestats()` and `ggbarstats()` (#935).
28+
- Empty groups in factors are no longer dropped in `ggpiestats()` and
29+
`ggbarstats()` (#935).
1730

1831
# ggstatsplot 0.12.3
1932

R/ggbarstats.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ ggbarstats <- function(
121121
descriptive_df <- descriptive_data(data, {{ x }}, {{ y }}, label, digits.perc)
122122

123123
# data frame containing all details needed for prop test
124-
onesample_df <- onesample_data(data, {{ x }}, {{ y }}, digits)
124+
onesample_df <- onesample_data(data, {{ x }}, {{ y }}, digits, ratio)
125125

126126
# if no. of factor levels is greater than the default palette color count
127127
.is_palette_sufficient(package, palette, nlevels(pull(data, {{ x }})))

R/ggcoefstats.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#' estimates of coefficients or other quantities of interest).
2020
#' @param statistic Relevant statistic for the model (`"t"`, `"f"`, `"z"`, or
2121
#' `"chi"`) in the label. Relevant only if `x` is a *data frame*.
22-
#' @param effectsize.type This is the same as `effectsize_type` argument of
22+
#' @param effectsize.type This is the same as `es_type` argument of
2323
#' `parameters::model_parameters()`. Defaults to `"eta"`, and relevant for
2424
#' ANOVA-like objects.
2525
#' @param bf.message Logical that decides whether results from running a
@@ -165,10 +165,10 @@ ggcoefstats <- function(
165165

166166
# converting model object to a tidy data frame
167167
tidy_df <- tidy_model_parameters(
168-
model = x,
169-
effectsize_type = effectsize.type,
170-
ci = conf.level,
171-
table_wide = TRUE,
168+
model = x,
169+
es_type = effectsize.type,
170+
ci = conf.level,
171+
table_wide = TRUE,
172172
...
173173
)
174174

R/ggpiestats-ggbarstats-helpers.R

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ descriptive_data <- function(
3636
#' @title A data frame with chi-squared test results
3737
#' @autoglobal
3838
#' @noRd
39-
onesample_data <- function(data, x, y, digits = 2L, ...) {
39+
onesample_data <- function(data, x, y, digits = 2L, ratio = NULL, ...) {
4040
full_join(
4141
# descriptive summary
4242
x = .cat_counter(data, {{ y }}) %>%
4343
mutate(N = paste0("(n = ", .prettyNum(counts), ")")),
4444
# proportion test results
4545
y = group_by(data, {{ y }}) %>%
46-
group_modify(.f = ~ .chisq_test_safe(., {{ x }})) %>%
46+
group_modify(.f = ~ .chisq_test_safe(., {{ x }}, ratio)) %>%
4747
ungroup(),
4848
by = as_name(ensym(y))
4949
) %>%
@@ -60,22 +60,16 @@ onesample_data <- function(data, x, y, digits = 2L, ...) {
6060
#' Needed to work with `group_modify()` since it will not work when `NULL` is returned
6161
#' @autoglobal
6262
#' @noRd
63-
.chisq_test_safe <- function(data, x, ...) {
64-
xtab <- table(pull(data, {{ x }}))
65-
66-
result <- tryCatch(
67-
expr = parameters::model_parameters(suppressWarnings(stats::chisq.test(xtab))),
68-
error = function(e) NULL
63+
.chisq_test_safe <- function(data, x, ratio) {
64+
tryCatch(
65+
suppressWarnings(contingency_table(data, x, ratio = ratio)),
66+
error = function(e) {
67+
tibble(
68+
statistic = NA_real_, p.value = NA_real_, df = NA_real_,
69+
method = "Chi-squared test for given probabilities"
70+
)
71+
}
6972
)
70-
71-
if (is.null(result)) {
72-
tibble(
73-
statistic = NA_real_, p.value = NA_real_, df = NA_real_,
74-
method = "Chi-squared test for given probabilities"
75-
)
76-
} else {
77-
insight::standardize_names(result, style = "broom") %>% as_tibble()
78-
}
7973
}
8074

8175

R/ggpiestats.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ ggpiestats <- function(
153153
descriptive_df <- descriptive_data(data, {{ x }}, {{ y }}, label, digits.perc)
154154

155155
# data frame containing all details needed for proportion test
156-
if (test == "two.way") onesample_df <- onesample_data(data, {{ x }}, {{ y }}, digits)
156+
if (test == "two.way") onesample_df <- onesample_data(data, {{ x }}, {{ y }}, digits, ratio)
157157

158158
# if no. of factor levels is greater than the default palette color count
159159
.is_palette_sufficient(package, palette, min_length = x_levels)

0 commit comments

Comments
 (0)