From f2fd76d96c93568ddda4c4dfb2d3420739e4172b Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Wed, 11 Jun 2025 12:19:55 -0400 Subject: [PATCH 1/6] Update to work with ggplot2 version 4.0.0; prepare for release --- DESCRIPTION | 2 +- NEWS.md | 3 ++- tests/testthat/test-gglist.R | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ea6e70e..1f636ed 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ggtibble Title: Create Tibbles and Lists of 'ggplot' Figures for Reporting -Version: 1.0.1.9000 +Version: 1.0.2 Authors@R: person("Bill", "Denney", email="wdenney@humanpredictions.com", role=c("aut", "cre"), comment=c(ORCID="0000-0002-5759-428X")) Description: diff --git a/NEWS.md b/NEWS.md index f0e6c3e..a87c389 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# ggtibble 1.0.1.9000 +# ggtibble 1.0.2 * `ggtibble()` now warns if `outercols` are not used in either the `caption` or the `labs` argument (#13). @@ -9,6 +9,7 @@ objects (#23). * `ggsave()` can accept a character vector of all filenames to use when saving (#25). +* Update testing to work with ggplot2 version 4.0.0 # ggtibble 1.0.1 diff --git a/tests/testthat/test-gglist.R b/tests/testthat/test-gglist.R index 83131f0..b2bb8f9 100644 --- a/tests/testthat/test-gglist.R +++ b/tests/testthat/test-gglist.R @@ -88,7 +88,7 @@ test_that("vec_arith for gglists", { test_that("new_gglist accepted input classes", { expect_s3_class( - new_gglist(list(ggplot2::labs("foo"))), + new_gglist(list(ggplot2::labs(x = "foo"))), "gglist" ) expect_s3_class( From 2b93667e626b2b9ee8206a8f822e0424d0e47c54 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Wed, 11 Jun 2025 12:20:59 -0400 Subject: [PATCH 2/6] Update docs --- man/ggsave.Rd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man/ggsave.Rd b/man/ggsave.Rd index 504b115..6791165 100644 --- a/man/ggsave.Rd +++ b/man/ggsave.Rd @@ -78,7 +78,8 @@ If not supplied, uses the size of the current graphics device.} arguments are expressed: \code{"in"}, \code{"cm"}, \code{"mm"} or \code{"px"}.} \item{dpi}{Plot resolution. Also accepts a string input: "retina" (320), -"print" (300), or "screen" (72). Applies only to raster output types.} +"print" (300), or "screen" (72). Only applies when converting pixel units, +as is typical for raster output types.} \item{limitsize}{When \code{TRUE} (the default), \code{ggsave()} will not save images larger than 50x50 inches, to prevent the common error of From 35d1cb043c15a6a592c20210c4ea7e17472bfac2 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Wed, 11 Jun 2025 12:24:09 -0400 Subject: [PATCH 3/6] Update documentation for devtools::check() --- R/ggsave.R | 2 +- man/ggsave.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ggsave.R b/R/ggsave.R index 061e76e..e49f0cb 100644 --- a/R/ggsave.R +++ b/R/ggsave.R @@ -3,7 +3,7 @@ #' @inheritParams ggplot2::ggsave #' @export ggsave <- function(filename, - plot = last_plot(), + plot = ggplot2::last_plot(), device = NULL, path = NULL, scale = 1, diff --git a/man/ggsave.Rd b/man/ggsave.Rd index 6791165..9c36232 100644 --- a/man/ggsave.Rd +++ b/man/ggsave.Rd @@ -8,7 +8,7 @@ \usage{ ggsave( filename, - plot = last_plot(), + plot = ggplot2::last_plot(), device = NULL, path = NULL, scale = 1, From 4f12c50b8beb52dcae0c02680676edf3bc68f070 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Wed, 11 Jun 2025 12:24:44 -0400 Subject: [PATCH 4/6] Update spell check --- inst/WORDLIST | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/inst/WORDLIST b/inst/WORDLIST index f0feda5..8029ad6 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,12 +1,21 @@ CMD Codecov Tibbles +bmp +colour +eps geoms gg gglist ggplot ggplots -px +jpeg +pictex +png +ps sprintf +svg +tex tibble tibbles +wmf From b837732648209d298330bcbf01738598c218bad4 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Wed, 11 Jun 2025 12:30:39 -0400 Subject: [PATCH 5/6] Improve test coverage --- tests/testthat/test-ggsave.R | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/testthat/test-ggsave.R b/tests/testthat/test-ggsave.R index e490a80..9268b4e 100644 --- a/tests/testthat/test-ggsave.R +++ b/tests/testthat/test-ggsave.R @@ -75,3 +75,27 @@ test_that("ggsave with all filenames specified (#25)", { fixed = TRUE ) }) + +test_that("ggsave.default", { + d_plot <- + data.frame( + A = rep(c("foo", "bar"), each = 4), + B = 1:8, + C = 11:18, + Bunit = "mg", + Cunit = "km" + ) + current_plots <- + ggplot2::ggplot( + d_plot, + ggplot2::aes(x = B, y = C) + ) + + ggplot2::geom_point() + + ggplot2::geom_line() + expected_file <- file.path(tempdir(), "foo.png") + expect_equal( + ggsave(filename = "foo.png", plot = current_plots, path = tempdir()), + expected_file + ) + unlink(expected_file) +}) From 32a925dc597c453e211c276a4196080e4a8dc752 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Wed, 11 Jun 2025 13:10:06 -0400 Subject: [PATCH 6/6] Update URL --- DESCRIPTION | 4 ++-- README.md | 6 +++--- _pkgdown.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1f636ed..85566d5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,7 +30,7 @@ Imports: tibble, tidyr, vctrs -URL: https://billdenney.github.io/ggtibble/, https://github.com/billdenney/ggtibble -BugReports: https://github.com/billdenney/ggtibble/issues +URL: https://humanpred.github.io/ggtibble/, https://github.com/humanpred/ggtibble +BugReports: https://github.com/humanpred/ggtibble/issues Language: en-US VignetteBuilder: knitr diff --git a/README.md b/README.md index 5aec5ad..feec4ec 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ # ggtibble -[![R-CMD-check](https://github.com/billdenney/ggtibble/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/billdenney/ggtibble/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check](https://github.com/humanpred/ggtibble/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/humanpred/ggtibble/actions/workflows/R-CMD-check.yaml) [![CRAN status](https://www.r-pkg.org/badges/version/ggtibble)](https://CRAN.R-project.org/package=ggtibble) -[![Codecov test coverage](https://codecov.io/gh/billdenney/ggtibble/branch/main/graph/badge.svg)](https://app.codecov.io/gh/billdenney/ggtibble?branch=main) +[![Codecov test coverage](https://codecov.io/gh/humanpred/ggtibble/branch/main/graph/badge.svg)](https://app.codecov.io/gh/humanpred/ggtibble?branch=main) The goal of `ggtibble` is to allow creation of similarly-formatted figures as @@ -18,7 +18,7 @@ You can install the development version of `ggtibble` from ``` r # install.packages("devtools") -devtools::install_github("billdenney/ggtibble") +devtools::install_github("humanpred/ggtibble") ``` ## Example diff --git a/_pkgdown.yml b/_pkgdown.yml index b75e4a2..78f8459 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://billdenney.github.io/ggtibble/ +url: https://humanpred.github.io/ggtibble/ template: bootstrap: 5