diff --git a/DESCRIPTION b/DESCRIPTION index 1aa71fb..057edd4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,6 +27,7 @@ Imports: utils Suggests: ambient, + aRtsy, ggplot2 (>= 3.5.0), gtable, knitr, diff --git a/R/pattern-pattern-aRtsy.R b/R/pattern-pattern-aRtsy.R index 0ae8197..b15834e 100644 --- a/R/pattern-pattern-aRtsy.R +++ b/R/pattern-pattern-aRtsy.R @@ -41,7 +41,9 @@ create_pattern_aRtsy <- function(params, boundary_df, aspect_ratio, #' @param ... Currently ignored #' @return A grid grob object invisibly. If `draw` is `TRUE` then also draws to the graphic device as a side effect. #' @examples -#' print(names_aRtsy()) +#' if (requireNamespace("aRtsy", quietly = TRUE)) { +#' print(names_aRtsy()) +#' } #' #' \donttest{# Make take more than 5 seconds on CRAN servers #' x_hex <- 0.5 + 0.5 * cos(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6)) diff --git a/man/grid.pattern_aRtsy.Rd b/man/grid.pattern_aRtsy.Rd index 35429f0..4fafee7 100644 --- a/man/grid.pattern_aRtsy.Rd +++ b/man/grid.pattern_aRtsy.Rd @@ -10,7 +10,7 @@ grid.pattern_aRtsy( y = c(1, 0, 0, 1), id = 1L, ..., - type = "forest", + type = "strokes", fill = gp$fill \%||\% "grey80", alpha = gp$alpha \%||\% NA_real_, default.units = "npc", @@ -60,7 +60,9 @@ A grid grob object invisibly. If \code{draw} is \code{TRUE} then also draws to \code{names_aRtsy()} returns character vector of supported types. } \examples{ -print(names_aRtsy()) +if (requireNamespace("aRtsy", quietly = TRUE)) { + print(names_aRtsy()) +} \donttest{# Make take more than 5 seconds on CRAN servers x_hex <- 0.5 + 0.5 * cos(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6)) @@ -68,7 +70,7 @@ y_hex <- 0.5 + 0.5 * sin(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6)) if (requireNamespace("aRtsy", quietly = TRUE) && guess_has_R4.1_features("patterns")) { grid::grid.newpage() - grid.pattern_aRtsy(x_hex, y_hex, type = "forest", + grid.pattern_aRtsy(x_hex, y_hex, type = "forest", fill = c("black", "white", "grey")) } }