Skip to content

Commit 7f6b18b

Browse files
Add annotation.args examples to all grouped_ function documentation (#1025)
Updates examples for `grouped_` functions to demonstrate `annotation.args` usage, addressing documentation gap where some functions lacked examples of this parameter. ### Changes - **R source files updated**: `ggbetweenstats.R`, `ggwithinstats.R`, `ggbarstats.R`, `ggpiestats.R`, `ggdotplotstats.R` - **Man pages updated**: corresponding `.Rd` files in `man/` ### Example ```r grouped_ggbetweenstats( data = filter(movies_long, genre %in% c("Action", "Comedy"), mpaa %in% c("R", "PG")), x = genre, y = rating, grouping.var = mpaa, ggplot.component = scale_y_continuous(breaks = seq(1, 9, 1), limits = c(1, 9)), annotation.args = list(title = "Ratings by genre for different MPAA ratings") ) ``` ### Functions already covered (unchanged) - `grouped_gghistostats`, `grouped_ggcorrmat`, `grouped_ggscatterstats` <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Update all examples for `grouped_` to show how to use `annotation.args` argument</issue_title> > <issue_description></issue_description> > > <agent_instructions>Also make sure to update `man/.Rd` files for this change</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes #1024 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: IndrajeetPatil <[email protected]> Co-authored-by: Indrajeet Patil <[email protected]>
1 parent 7d85142 commit 7f6b18b

12 files changed

+51
-33
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ Imports:
3737
ggcorrplot (>= 0.1.4.1),
3838
ggplot2 (>= 4.0.1),
3939
ggrepel (>= 0.9.6),
40-
ggside (>= 0.4.0),
40+
ggside (>= 0.4.1),
4141
ggsignif (>= 0.6.4),
4242
glue (>= 1.8.0),
43-
insight (>= 1.4.2),
43+
insight (>= 1.4.3),
4444
magrittr (>= 2.0.4),
4545
paletteer (>= 1.6.0),
46-
parameters (>= 0.28.2),
46+
parameters (>= 0.28.3),
4747
patchwork (>= 1.3.2),
4848
performance (>= 0.15.2),
4949
purrr (>= 1.2.0),

R/ggbarstats.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,12 @@ ggbarstats <- function(
214214
#' sample_frac(size = 0.05)
215215
#'
216216
#' grouped_ggbarstats(
217-
#' data = diamonds_short,
218-
#' x = color,
219-
#' y = clarity,
220-
#' grouping.var = cut,
221-
#' plotgrid.args = list(nrow = 2L)
217+
#' data = diamonds_short,
218+
#' x = color,
219+
#' y = clarity,
220+
#' grouping.var = cut,
221+
#' plotgrid.args = list(nrow = 2L),
222+
#' annotation.args = list(title = "Diamond quality by color and clarity")
222223
#' )
223224
#' @export
224225
grouped_ggbarstats <- function(

R/ggbetweenstats.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ ggbetweenstats <- function(
352352
#' ggplot.component = scale_y_continuous(
353353
#' breaks = seq(1, 9, 1),
354354
#' limits = (c(1, 9))
355-
#' )
355+
#' ),
356+
#' annotation.args = list(title = "Ratings by genre for different MPAA ratings")
356357
#' )
357358
#' @export
358359
grouped_ggbetweenstats <- function(

R/ggdotplotstats.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,12 @@ ggdotplotstats <- function(
200200
#'
201201
#' # plot
202202
#' grouped_ggdotplotstats(
203-
#' data = df,
204-
#' x = cty,
205-
#' y = manufacturer,
206-
#' grouping.var = cyl,
207-
#' test.value = 15.5
203+
#' data = df,
204+
#' x = cty,
205+
#' y = manufacturer,
206+
#' grouping.var = cyl,
207+
#' test.value = 15.5,
208+
#' annotation.args = list(title = "City mileage by manufacturer for different cylinders")
208209
#' )
209210
#' @export
210211
grouped_ggdotplotstats <- function(

R/ggpiestats.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,12 @@ ggpiestats <- function(
248248
#' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true")
249249
#' set.seed(123)
250250
#' # grouped one-sample proportion test
251-
#' grouped_ggpiestats(mtcars, x = cyl, grouping.var = am)
251+
#' grouped_ggpiestats(
252+
#' data = mtcars,
253+
#' x = cyl,
254+
#' grouping.var = am,
255+
#' annotation.args = list(title = "Cylinder distribution by transmission type")
256+
#' )
252257
#' @export
253258
grouped_ggpiestats <- function(
254259
data,

R/ggwithinstats.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ ggwithinstats <- function(
272272
#' grouping.var = gender,
273273
#' type = "np",
274274
#' # additional modifications for **each** plot using `{ggplot2}` functions
275-
#' ggplot.component = scale_y_continuous(breaks = seq(0, 10, 1), limits = c(0, 10))
275+
#' ggplot.component = scale_y_continuous(breaks = seq(0, 10, 1), limits = c(0, 10)),
276+
#' annotation.args = list(title = "Desire ratings by condition for each gender")
276277
#' )
277278
#' @export
278279
grouped_ggwithinstats <- function(

codemeta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@
385385
"@type": "SoftwareApplication",
386386
"identifier": "ggside",
387387
"name": "ggside",
388-
"version": ">= 0.4.0",
388+
"version": ">= 0.4.1",
389389
"provider": {
390390
"@id": "https://cran.r-project.org",
391391
"@type": "Organization",
@@ -424,7 +424,7 @@
424424
"@type": "SoftwareApplication",
425425
"identifier": "insight",
426426
"name": "insight",
427-
"version": ">= 1.4.2",
427+
"version": ">= 1.4.3",
428428
"provider": {
429429
"@id": "https://cran.r-project.org",
430430
"@type": "Organization",
@@ -463,7 +463,7 @@
463463
"@type": "SoftwareApplication",
464464
"identifier": "parameters",
465465
"name": "parameters",
466-
"version": ">= 0.28.2",
466+
"version": ">= 0.28.3",
467467
"provider": {
468468
"@id": "https://cran.r-project.org",
469469
"@type": "Organization",
@@ -557,7 +557,7 @@
557557
},
558558
"SystemRequirements": null
559559
},
560-
"fileSize": "9310.333KB",
560+
"fileSize": "9311.344KB",
561561
"citation": [
562562
{
563563
"@type": "ScholarlyArticle",

man/grouped_ggbarstats.Rd

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/grouped_ggbetweenstats.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/grouped_ggdotplotstats.Rd

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)