diff --git a/DESCRIPTION b/DESCRIPTION index ea6e70e..85566d5 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: @@ -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/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/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/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 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 diff --git a/man/ggsave.Rd b/man/ggsave.Rd index 504b115..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, @@ -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 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( 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) +})