diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 87da0194..b3f013d8 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -26,13 +26,20 @@ jobs: fail-fast: false matrix: # devel only on schedule + manual dispatch; push/PR get stable only - ggplot2: ${{ fromJSON((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && '[">= 3.5.2", "devel"]' || '[">= 3.5.2"]') }} + ggplot2: ${{ fromJSON((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && '["release", "devel"]' || '["release"]') }} config: - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - {os: ubuntu-latest, r: 'oldrel-1'} + # minimum supported ggplot2 version (see DESCRIPTION) + include: + - ggplot2: '3.5.2' + config: {os: ubuntu-latest, r: 'release'} + # current versions of some suggested packages used in the + # vignettes (e.g., ggtree, ggpattern) require ggplot2 >= 4.0.0 + skip_vignettes: true env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -59,12 +66,13 @@ jobs: extra-packages: any::rcmdcheck needs: check + # the release version is already installed by setup-r-dependencies - name: Install ggplot2 ${{ matrix.ggplot2 }} run: | install.packages("remotes") remotes::install_version("ggplot2", version = "${{ matrix.ggplot2 }}") shell: Rscript {0} - if: matrix.ggplot2 != 'devel' + if: matrix.ggplot2 != 'devel' && matrix.ggplot2 != 'release' - name: Install development ggplot2 run: | @@ -79,4 +87,8 @@ jobs: _R_CHECK_FORCE_SUGGESTS_: 0 with: upload-snapshots: true - build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' + build_args: ${{ matrix.skip_vignettes && 'c("--no-manual","--no-build-vignettes")' || 'c("--no-manual","--compact-vignettes=gs+qpdf")' }} + args: ${{ matrix.skip_vignettes && 'c("--no-manual","--as-cran","--ignore-vignettes")' || 'c("--no-manual","--as-cran")' }} + # without vignettes, and with docs inherited from newer ggplot2 + # versions, only errors are meaningful for the minimum version job + error-on: ${{ matrix.skip_vignettes && '"error"' || '"warning"' }} diff --git a/DESCRIPTION b/DESCRIPTION index 9d0a39bb..86c04e98 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,7 +20,7 @@ LazyData: true biocViews: Imports: deeptimedata, - ggplot2 (>= 3.5.0), + ggplot2 (>= 3.5.2), utils, ggforce, grid, diff --git a/NEWS.md b/NEWS.md index e56a7c34..eaf2c8fc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # deeptime (development version) +__deeptime now requires ggplot2 version 3.5.2 or higher__, matching the requirement of its ggh4x dependency. + # deeptime 2.4.0 __deeptime now requires R version 4.1 or higher__. diff --git a/tests/testthat/_snaps/coord_geo/stacked-scales-on-left-right-new.svg b/tests/testthat/_snaps/coord_geo/stacked-scales-on-left-right-new.svg new file mode 100644 index 00000000..764c94dd --- /dev/null +++ b/tests/testthat/_snaps/coord_geo/stacked-scales-on-left-right-new.svg @@ -0,0 +1,542 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PT1 +PL6 +PL5 +PL3 +PL2 +PL1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C1 +C2 +C2A +C3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C1 +C2 +C2A +C3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PT1 +PL6 +PL5 +PL3 +PL2 +PL1 + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + +2 +3 +4 +5 +6 +d18O +Time (Ma) +stacked scales on left-right new + + diff --git a/tests/testthat/_snaps/coord_geo/stacked-scales-on-top-bottom-new.svg b/tests/testthat/_snaps/coord_geo/stacked-scales-on-top-bottom-new.svg new file mode 100644 index 00000000..f92a27f7 --- /dev/null +++ b/tests/testthat/_snaps/coord_geo/stacked-scales-on-top-bottom-new.svg @@ -0,0 +1,476 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PT1 +PL6 +PL5 +PL3 +PL2 +PL1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C1 +C2 +C2A +C3 + + + + + + + +2 +3 +4 +5 +6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C1 +C2 +C2A +C3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PT1 +PL6 +PL5 +PL3 +PL2 +PL1 + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 +Time (Ma) +d18O +stacked scales on top-bottom new + + diff --git a/tests/testthat/_snaps/coord_geo/stacked-scales-with-single-pos-new.svg b/tests/testthat/_snaps/coord_geo/stacked-scales-with-single-pos-new.svg index bd2fd01a..510e3761 100644 --- a/tests/testthat/_snaps/coord_geo/stacked-scales-with-single-pos-new.svg +++ b/tests/testthat/_snaps/coord_geo/stacked-scales-with-single-pos-new.svg @@ -48,6 +48,10 @@ + + + + @@ -177,6 +181,10 @@ + + + + @@ -245,6 +253,10 @@ + + + + diff --git a/tests/testthat/test-guides.R b/tests/testthat/test-guides.R index 55a358bf..a825058c 100644 --- a/tests/testthat/test-guides.R +++ b/tests/testthat/test-guides.R @@ -180,6 +180,7 @@ test_that("ggtree scale works with only fossil taxa", { }) test_that("guide_geo works with coord_geo_radial", { + skip_if_not_installed("ggtree") skip_if_not_installed("ape") gg <- revts(ggtree(tree)) + coord_geo_radial(dat = "epochs", end = 1.49 * pi, @@ -196,6 +197,7 @@ test_that("guide_geo works with coord_geo_radial", { }) test_that("ggtree scale works with only fossil taxa", { + skip_if_not_installed("ggtree") skip_if_not_installed("paleotree") gg <- ggtree(ceratopsianTreeRaia, position = position_nudge(x = -ceratopsianTreeRaia$root.time)) +