From 810173bb2da71a05bf70860fb08b9fb628b017f0 Mon Sep 17 00:00:00 2001 From: Andrew Dolman Date: Sun, 15 Jun 2025 17:14:13 +0200 Subject: [PATCH 1/2] fix tests for ggplot objects --- tests/testthat/test-ClimToProxyClim.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-ClimToProxyClim.R b/tests/testthat/test-ClimToProxyClim.R index 64bddcb..3d1cda0 100644 --- a/tests/testthat/test-ClimToProxyClim.R +++ b/tests/testthat/test-ClimToProxyClim.R @@ -329,7 +329,8 @@ test_that("example from paper works", { expected = data.frame(PFM.ex$simulated.proxy)) p <- PlotPFMs(PFM.ex) - testthat::expect_equal(class(p), c("gg", "ggplot")) + testthat::expect_true(ggplot2::is_ggplot(p)) + }) From b8000912e3c0c63ed19ff492a662180388823dad Mon Sep 17 00:00:00 2001 From: Andrew Dolman Date: Sun, 15 Jun 2025 17:35:02 +0200 Subject: [PATCH 2/2] additional warning fixes --- DESCRIPTION | 4 +- NEWS.md | 5 + R/ClimToProxyClim.R | 2 +- R/sedproxy.R | 3 +- README.md | 42 +- man/ClimToProxyClim.Rd | 4 +- man/figures/README-MgCa_plot-1.svg | 1311 ++++++++++++------------- man/figures/README-default_plot-1.svg | 845 ++++++++-------- man/figures/README-plot_reps-1.svg | 591 ++++++----- man/sedproxy.Rd | 18 + 10 files changed, 1404 insertions(+), 1421 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 312f5da..5bc8e70 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: sedproxy Title: Simulation of Sediment Archived Climate Proxy Records -Version: 0.7.5.1 +Version: 0.7.5.2 Authors@R: c(person("Thomas", "Laepple", email = "tlaepple@awi.de", role = c("aut")), person("Andrew", "Dolman", email = "andrew.dolman@awi.de", role = c("aut", "cre"))) Description: Proxy forward modelling for sediment archived climate proxies such @@ -13,7 +13,7 @@ License: MIT + file LICENSE Encoding: UTF-8 Language: en-gb LazyData: true -RoxygenNote: 7.2.0 +RoxygenNote: 7.3.2 Depends: R (>= 3.5.0) Imports: stats, mvtnorm, dplyr, tidyr, ggplot2, rlang diff --git a/NEWS.md b/NEWS.md index d5f256a..b461ecd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# sedproxy 0.7.5.2 +* fixed test for ggplot2 objects to address https://github.com/tidyverse/ggplot2/issues/6498 +* fixed additional warnings for using .data in tidyselect +* fixed warning for using @docType "package" + # sedproxy 0.7.5.1 * fix bug in mixed layer modelling where top of core is assumed to be age == 0 diff --git a/R/ClimToProxyClim.R b/R/ClimToProxyClim.R index 1ed760b..f82a219 100644 --- a/R/ClimToProxyClim.R +++ b/R/ClimToProxyClim.R @@ -1003,7 +1003,7 @@ MakePFMDataframe <- function(PFM){ rtn <- dplyr::bind_rows(df, df2, df.smoothed) rtn <- droplevels(dplyr::filter(rtn, stats::complete.cases(.data$value))) - rtn <- dplyr::left_join(rtn, dplyr::select(sedproxy::stages.key, stage, scale, .data$label), by = "stage") + rtn <- dplyr::left_join(rtn, dplyr::select(sedproxy::stages.key, stage, scale, "label"), by = "stage") #rtn <- select(rtn, -plotting.colour, -plotting.alpha) return(rtn) diff --git a/R/sedproxy.R b/R/sedproxy.R index 33e5377..ef13f03 100644 --- a/R/sedproxy.R +++ b/R/sedproxy.R @@ -1,9 +1,8 @@ #' sedproxy: Simulation of Sediment Archived Climate Proxy Records #' #' The sedproxy package provides functions to simulate sediment archived proxies -#' @docType package #' @name sedproxy -NULL +"_PACKAGE" #' @title Description of proxy stages #' @description A description of the proxy stages in the output of \code{ClimToProxyClim} diff --git a/README.md b/README.md index 2c89e06..d26af22 100644 --- a/README.md +++ b/README.md @@ -193,20 +193,20 @@ PFM <- ClimToProxyClim(clim.signal = clim.in, PFM$everything ``` - ## # A tibble: 14,045 x 7 + ## # A tibble: 14,045 × 7 ## timepoints n.samples replicate stage value scale label ## - ## 1 4334 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia~ - ## 2 4527 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia~ - ## 3 4576 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia~ - ## 4 4721 30 1 proxy.bt.sb.sampY 27.6 Proxy units (4) +Alia~ - ## 5 4914 30 1 proxy.bt.sb.sampY 27.6 Proxy units (4) +Alia~ - ## 6 4994 30 1 proxy.bt.sb.sampY 27.6 Proxy units (4) +Alia~ - ## 7 5092 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia~ - ## 8 5156 30 1 proxy.bt.sb.sampY 27.6 Proxy units (4) +Alia~ - ## 9 5254 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia~ - ## 10 5318 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia~ - ## # ... with 14,035 more rows + ## 1 4334 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia… + ## 2 4527 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia… + ## 3 4576 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia… + ## 4 4721 30 1 proxy.bt.sb.sampY 27.6 Proxy units (4) +Alia… + ## 5 4914 30 1 proxy.bt.sb.sampY 27.6 Proxy units (4) +Alia… + ## 6 4994 30 1 proxy.bt.sb.sampY 27.6 Proxy units (4) +Alia… + ## 7 5092 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia… + ## 8 5156 30 1 proxy.bt.sb.sampY 27.6 Proxy units (4) +Alia… + ## 9 5254 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia… + ## 10 5318 30 1 proxy.bt.sb.sampY 27.7 Proxy units (4) +Alia… + ## # ℹ 14,035 more rows **Simple plotting** @@ -215,9 +215,9 @@ PFM %>% PlotPFMs(max.replicates = 1) ``` - ## Joining, by = c("stage", "scale") - ## Scale for 'alpha' is already present. Adding another scale for 'alpha', which - ## will replace the existing scale. + ## Joining with `by = join_by(stage, scale)` + ## Scale for alpha is already present. Adding another scale for alpha, which will + ## replace the existing scale. @@ -229,9 +229,9 @@ PFM %>% PlotPFMs(., max.replicates = 5, plot.stages = "simulated.proxy") ``` - ## Joining, by = c("stage", "scale") - ## Scale for 'alpha' is already present. Adding another scale for 'alpha', which - ## will replace the existing scale. + ## Joining with `by = join_by(stage, scale)` + ## Scale for alpha is already present. Adding another scale for alpha, which will + ## replace the existing scale. @@ -243,9 +243,9 @@ Sensor stage of the proxy system. ## Rescaling noise - ## Joining, by = c("stage", "scale") - ## Scale for 'alpha' is already present. Adding another scale for 'alpha', which - ## will replace the existing scale. + ## Joining with `by = join_by(stage, scale)` + ## Scale for alpha is already present. Adding another scale for alpha, which will + ## replace the existing scale. diff --git a/man/ClimToProxyClim.Rd b/man/ClimToProxyClim.Rd index 4f2b233..b8b9d00 100644 --- a/man/ClimToProxyClim.Rd +++ b/man/ClimToProxyClim.Rd @@ -12,8 +12,8 @@ ClimToProxyClim( "Ten planktonic species_350-500"), slp.int.means = NULL, slp.int.vcov = NULL, - noise.type = switch(calibration.type, identity = "additive", Uk37 = "additive", MgCa - = "multiplicative"), + noise.type = switch(calibration.type, identity = "additive", Uk37 = "additive", MgCa = + "multiplicative"), plot.sig.res = 100, habitat.weights = rep(1/ncol(clim.signal), ncol(clim.signal)), habitat.wt.args = NULL, diff --git a/man/figures/README-MgCa_plot-1.svg b/man/figures/README-MgCa_plot-1.svg index ed8b482..34e6522 100644 --- a/man/figures/README-MgCa_plot-1.svg +++ b/man/figures/README-MgCa_plot-1.svg @@ -1,691 +1,678 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/man/figures/README-default_plot-1.svg b/man/figures/README-default_plot-1.svg index c01b609..f6b3d79 100644 --- a/man/figures/README-default_plot-1.svg +++ b/man/figures/README-default_plot-1.svg @@ -1,447 +1,434 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/man/figures/README-plot_reps-1.svg b/man/figures/README-plot_reps-1.svg index 088cf4e..4df1def 100644 --- a/man/figures/README-plot_reps-1.svg +++ b/man/figures/README-plot_reps-1.svg @@ -1,320 +1,307 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/man/sedproxy.Rd b/man/sedproxy.Rd index 15d6ca8..20e4fe9 100644 --- a/man/sedproxy.Rd +++ b/man/sedproxy.Rd @@ -2,8 +2,26 @@ % Please edit documentation in R/sedproxy.R \docType{package} \name{sedproxy} +\alias{sedproxy-package} \alias{sedproxy} \title{sedproxy: Simulation of Sediment Archived Climate Proxy Records} \description{ The sedproxy package provides functions to simulate sediment archived proxies } +\seealso{ +Useful links: +\itemize{ + \item \url{https://earthsystemdiagnostics.github.io/sedproxy/} + \item \url{https://github.com/EarthSystemDiagnostics/sedproxy} +} + +} +\author{ +\strong{Maintainer}: Andrew Dolman \email{andrew.dolman@awi.de} + +Authors: +\itemize{ + \item Thomas Laepple \email{tlaepple@awi.de} +} + +}