Skip to content

Commit 121a1c8

Browse files
authored
Update outdated ggscatterstats vignette examples to match current API (#1041)
1 parent f9c993a commit 121a1c8

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

vignettes/web_only/faq.Rmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ ggscatterstats(df, x, y, type = "robust")
114114
To see why the statistical analysis failed, you can look at the error from the
115115
underlying function:
116116

117-
```{r}
117+
```{r faq1}
118118
#| error = TRUE
119119
library(statsExpressions)
120120
df <- data.frame(x = 1, y = 2)
@@ -318,7 +318,7 @@ Behind the scenes, `{ggstatsplot}` uses `statsExpressions::pairwise_comparisons(
318318

319319
You can use it to extract actual data frames used in `{ggstatsplot}` functions.
320320

321-
```{r}
321+
```{r faq2}
322322
library(ggplot2)
323323
324324
pairwise_comparisons(mtcars, cyl, wt)
@@ -569,7 +569,7 @@ shinyApp(ui, server)
569569

570570
## 23. How to change size of annotations for combined plot in `grouped_*` functions?
571571

572-
```{r}
572+
```{r faq3}
573573
library(ggplot2)
574574
575575
grouped_ggbetweenstats(
@@ -592,7 +592,7 @@ grouped_ggbetweenstats(
592592

593593
## 24. How to change size of text in the subtitle?
594594

595-
```{r}
595+
```{r faq4}
596596
ggbetweenstats(
597597
data = iris,
598598
x = Species,
@@ -639,7 +639,7 @@ For MacOS, have a look at this [post](https://stackoverflow.com/questions/353608
639639

640640
## 28. How to modify the secondary Y-axis title?
641641

642-
```{r}
642+
```{r faq5}
643643
ggbetweenstats(
644644
mtcars, cyl, wt,
645645
ggplot.component = list(
@@ -650,7 +650,7 @@ ggbetweenstats(
650650

651651
## 29. How to turn off scientific notation in expressions?
652652

653-
```{r}
653+
```{r faq6}
654654
set.seed(123)
655655
library(ggstatsplot)
656656
library(WRS2)
@@ -677,7 +677,7 @@ By default, the whiskers in `ggbetweenstats()` box plots extend to 1.5 times the
677677
interquartile range (IQR) from the box, following the Tukey method. You can
678678
customize this using the `coef` parameter in `boxplot.args`:
679679

680-
```{r}
680+
```{r faq7}
681681
# Default whiskers (1.5 * IQR)
682682
ggbetweenstats(
683683
data = mtcars,

vignettes/web_only/ggcoefstats.Rmd

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,14 @@ library(metaplus)
462462
# renaming to what the function expects
463463
df <- dplyr::rename(mag, estimate = yi, std.error = sei, term = study)
464464
465-
ggcoefstats(
466-
x = df,
467-
meta.analytic.effect = TRUE,
468-
meta.type = "bayes",
469-
title = "Bayesian random-effects meta-analysis"
465+
# suppress Stan's divergent transitions warning (not under our control)
466+
suppressWarnings(
467+
ggcoefstats(
468+
x = df,
469+
meta.analytic.effect = TRUE,
470+
meta.type = "bayes",
471+
title = "Bayesian random-effects meta-analysis"
472+
)
470473
)
471474
```
472475

vignettes/web_only/ggscatterstats.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ ggscatterstats(
8383
label.var = title, ## variable to use for labeling data points
8484
label.expression = rating < 5 & budget > 100, ## expression for deciding which points to label
8585
point.label.args = list(alpha = 0.7, size = 4, color = "grey50"),
86-
xfill = "#CC79A7", ## fill for marginals on the x-axis
87-
yfill = "#009E73", ## fill for marginals on the y-axis
86+
xsidehistogram.args = list(fill = "#CC79A7"), ## fill for marginals on the x-axis
87+
ysidehistogram.args = list(fill = "#009E73"), ## fill for marginals on the y-axis
8888
title = "Relationship between movie budget and IMDB rating",
8989
caption = "Source: www.imdb.com"
9090
)

vignettes/web_only/purrr_examples.Rmd

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,16 @@ plot_list <- purrr::pmap(
272272
quote(rating > 8 & budget < 10)
273273
),
274274
type = list("r", "np", "bf"),
275-
xfill = list("#009E73", "#999999", "#0072B2"),
276-
yfill = list("#CC79A7", "#F0E442", "#D55E00"),
275+
xsidehistogram.args = list(
276+
list(fill = "#009E73"),
277+
list(fill = "#999999"),
278+
list(fill = "#0072B2")
279+
),
280+
ysidehistogram.args = list(
281+
list(fill = "#CC79A7"),
282+
list(fill = "#F0E442"),
283+
list(fill = "#D55E00")
284+
),
277285
ggtheme = list(
278286
ggthemes::theme_tufte(),
279287
ggplot2::theme_classic(),

0 commit comments

Comments
 (0)