From 4675e10f44d6cac7287c4a7a6947b3599c4e8cc7 Mon Sep 17 00:00:00 2001 From: Trevor L Davis Date: Tue, 16 Aug 2022 10:27:22 -0700 Subject: [PATCH] chore: Put some examples in \donttest{} * CRAN release was rejected because on one of the pre-check machines a couple of examples took more than 10 seconds * We wrap those examples in a \donttest{} --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/alphaMaskGrob.R | 2 ++ R/grid-pattern.R | 2 ++ cran-comments.md | 5 +++++ man/alphaMaskGrob.Rd | 2 ++ man/grid.pattern.Rd | 2 ++ 7 files changed, 15 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d935393..4ba80af 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: gridpattern Type: Package Title: 'grid' Pattern Grobs -Version: 1.0.0 +Version: 1.0.1 Authors@R: c(person("Mike", "FC", role = "aut", comment = "Code/docs adapted from ggpattern"), person("Trevor L", "Davis", role=c("aut", "cre"), email="trevor.l.davis@gmail.com", comment = c(ORCID = "0000-0001-6341-4639")), diff --git a/NEWS.md b/NEWS.md index 1bb7b4c..f3fbc75 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -gridpattern v1.0.0 +gridpattern v1.0.1 ================== Bug fixes and minor improvements diff --git a/R/alphaMaskGrob.R b/R/alphaMaskGrob.R index 972d7ce..ce6de6f 100644 --- a/R/alphaMaskGrob.R +++ b/R/alphaMaskGrob.R @@ -18,6 +18,7 @@ #' @return A `grid` grob #' @inheritParams grid::polygonGrob #' @examples +#' \donttest{ # Once took more >10s on a CRAN autocheck #' if (capabilities("png") && require("grid")) { #' maskee <- patternGrob("circle", gp = gpar(col = "black", fill = "yellow"), #' spacing = 0.1, density = 0.5) @@ -44,6 +45,7 @@ #' grid.newpage() #' grid.draw(masked_transparent) #' } +#' } #' @export alphaMaskGrob <- function(maskee, masker, use_R4.1_masks = getOption("ggpattern_use_R4.1_masks", diff --git a/R/grid-pattern.R b/R/grid-pattern.R index adf094e..6261390 100644 --- a/R/grid-pattern.R +++ b/R/grid-pattern.R @@ -61,6 +61,7 @@ #' If `draw` is `TRUE` then `grid.pattern()` also draws to the graphic device as a side effect. #' @examples #' print(names_pattern) +#' \donttest{ # Once took more >10s on a CRAN autocheck #' if (require("grid")) { #' x_hex <- 0.5 + 0.5 * cos(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6)) #' y_hex <- 0.5 + 0.5 * sin(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6)) @@ -107,6 +108,7 @@ #' grid.pattern("plasma", x_hex, y_hex, fill="green") #' } #' } +#' } #' @seealso \url{https://coolbutuseless.github.io/package/ggpattern/index.html} #' for more details on the `ggpattern` package. #' @export diff --git a/cran-comments.md b/cran-comments.md index a88af83..58fbcb8 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,8 @@ +* As requested by CRAN we rebuilt the package + documentation with a never version of `{roxygen}` +* A couple of examples that took more than 10s on the + Windows CRAN pre-check are now wrapped by a "\donttest{}". + ## Test environments * win-builder (windows, R devel) diff --git a/man/alphaMaskGrob.Rd b/man/alphaMaskGrob.Rd index ae9fa4a..a1bb426 100644 --- a/man/alphaMaskGrob.Rd +++ b/man/alphaMaskGrob.Rd @@ -50,6 +50,7 @@ A \code{grid} grob \code{alphaMaskGrob()} masks a grob using another grob to specify the (alpha) mask. } \examples{ + \donttest{ # Once took more >10s on a CRAN autocheck if (capabilities("png") && require("grid")) { maskee <- patternGrob("circle", gp = gpar(col = "black", fill = "yellow"), spacing = 0.1, density = 0.5) @@ -76,4 +77,5 @@ A \code{grid} grob grid.newpage() grid.draw(masked_transparent) } + } } diff --git a/man/grid.pattern.Rd b/man/grid.pattern.Rd index 4c1e963..ce611ea 100644 --- a/man/grid.pattern.Rd +++ b/man/grid.pattern.Rd @@ -126,6 +126,7 @@ See \code{\link[=grid.pattern_weave]{grid.pattern_weave()}} for more information } \examples{ print(names_pattern) + \donttest{ # Once took more >10s on a CRAN autocheck if (require("grid")) { x_hex <- 0.5 + 0.5 * cos(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6)) y_hex <- 0.5 + 0.5 * sin(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6)) @@ -172,6 +173,7 @@ See \code{\link[=grid.pattern_weave]{grid.pattern_weave()}} for more information grid.pattern("plasma", x_hex, y_hex, fill="green") } } + } } \seealso{ \url{https://coolbutuseless.github.io/package/ggpattern/index.html}