From e0fd453591194f8b9ae736d6e67674d7aff06e65 Mon Sep 17 00:00:00 2001 From: "Trevor L. Davis" Date: Wed, 17 Apr 2024 21:22:22 -0700 Subject: [PATCH] refactor: Deprecated 'trans' for new 'transform' * In line with upstream changes in `{ggplot2}` the `trans` argument has been deprecated in various scales functions. Use the new `transform` argument instead (#113). * Several (continuous) scales now have an `...` argument which will passed onto `ggplot2::continuous_scale()`. * We now import {lifecycle} to help mark these deprecations but since {ggplot2} imports {lifecycle} and we import {ggplot2} this isn't a new de facto dependency. closes #113 --- DESCRIPTION | 3 +- NAMESPACE | 1 + NEWS.md | 6 + R/scale-pattern-size.R | 31 +- R/scale-pattern.R | 468 ++++++++++++------ R/zzz.R | 1 + data-raw/config.R | 4 - .../generate-scales-continuous-discrete.R | 66 +-- data-raw/generate-scales.R | 12 +- man/scale_continuous.Rd | 74 ++- man/scale_discrete.Rd | 50 +- man/scale_pattern_size_continuous.Rd | 14 +- 12 files changed, 477 insertions(+), 253 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 71a428d..9280377 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ggpattern Type: Package Title: 'ggplot2' Pattern Geoms -Version: 1.1.0-5 +Version: 1.1.0-6 Authors@R: c(person("Mike", "FC", role = "aut"), person("Trevor L.", "Davis", role = c("aut", "cre"), email = "trevor.l.davis@gmail.com", @@ -19,6 +19,7 @@ Imports: glue, grid, gridpattern (>= 1.2.0), + lifecycle, rlang, scales, Suggests: diff --git a/NAMESPACE b/NAMESPACE index 363eea6..3ad1a7c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -202,6 +202,7 @@ importFrom(grDevices,col2rgb) importFrom(grDevices,dev.off) importFrom(grDevices,png) importFrom(grDevices,rgb) +importFrom(lifecycle,deprecated) importFrom(stats,setNames) importFrom(utils,head) importFrom(utils,tail) diff --git a/NEWS.md b/NEWS.md index a0f428d..a07e33e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,11 @@ actual aspect ratio (instead of 1). This may cause your legends to `geom_sf_pattern()` to look different. +## Deprecated features + +* In line with upstream changes in `{ggplot2}` the `trans` argument has been deprecated in various scales functions. + Use the new `transform` argument instead (#113). + ## New features * `geom_bar_pattern()` and `geom_col_pattern()` now accept argument `just`. @@ -26,6 +31,7 @@ * `draw_key_boxplot_pattern()`, `draw_key_crossbar_pattern()`, and `draw_key_polygon_pattern()` `aspect_ratio` argument now defaults to `get_aspect_ratio()`. +* Several (continuous) scales now have an `...` argument which will be passed to `ggplot2::continuous_scale()`. # ggpattern 1.0.1 diff --git a/R/scale-pattern-size.R b/R/scale-pattern-size.R index fff660f..9d7555f 100644 --- a/R/scale-pattern-size.R +++ b/R/scale-pattern-size.R @@ -1,7 +1,7 @@ #----------------------------------------------------------------------------- #' Scales for area or radius #' -#' @param name,breaks,labels,limits,trans,guide See \code{ggplot2::scale_size} for more information +#' @param name,breaks,labels,limits,trans,guide,...,transform See [ggplot2::scale_size()] for more information #' @param range a numeric vector of length 2 that specifies the minimum and #' maximum size of the plotting symbol after transformation. #' @return A [ggplot2::Scale] object. @@ -33,10 +33,17 @@ #----------------------------------------------------------------------------- scale_pattern_size_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(1, 6), - trans = "identity", guide = "legend") { + trans = deprecated(), guide = "legend", + ..., transform = "identity") { + if (lifecycle::is_present(trans)) {{ + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_size_continuous(trans)', + 'scale_pattern_size_continuous(transform)') + transform <- trans + }} continuous_scale("pattern_size", palette = area_pal(range), name = name, - breaks = breaks, labels = labels, limits = limits, trans = trans, - guide = guide) + breaks = breaks, labels = labels, limits = limits, transform = transform, + guide = guide, ...) } #----------------------------------------------------------------------------- @@ -45,31 +52,15 @@ scale_pattern_size_continuous <- function(name = waiver(), breaks = waiver(), la #----------------------------------------------------------------------------- scale_pattern_size <- scale_pattern_size_continuous - -# #----------------------------------------------------------------------------- -# #' @rdname scale_pattern_size_continuous -# #' @export -# #----------------------------------------------------------------------------- -# scale_size_binned <- function(name = waiver(), breaks = waiver(), labels = waiver(), -# limits = NULL, range = c(1, 6), n.breaks = NULL, -# nice.breaks = TRUE, trans = "identity", guide = "bins") { -# binned_scale("size", palette = area_pal(range), name = name, -# breaks = breaks, labels = labels, limits = limits, trans = trans, -# n.breaks = n.breaks, nice.breaks = nice.breaks, guide = guide) -# } - - #----------------------------------------------------------------------------- #' @rdname scale_pattern_size_continuous #' @export #' @usage NULL #----------------------------------------------------------------------------- scale_pattern_size_discrete <- function(...) { - # warn("Using pattern_size for a discrete variable is not advised.") scale_pattern_size_ordinal(...) } - #----------------------------------------------------------------------------- #' @rdname scale_pattern_size_continuous #' @export diff --git a/R/scale-pattern.R b/R/scale-pattern.R index 734abc9..1f1187c 100644 --- a/R/scale-pattern.R +++ b/R/scale-pattern.R @@ -10,7 +10,7 @@ #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' Scales for continuous pattern aesthetics #' -#' @param name,breaks,labels,limits,range,trans,guide,... See +#' @param name,breaks,labels,limits,range,trans,guide,...,transform See #' \code{{ggplot2}} documentation for more information on scales. #' #' @return A [ggplot2::Scale] object. @@ -46,7 +46,7 @@ NULL #' Scales for discrete pattern aesthetics #' #' @param choices vector of values to choose from. -#' @param name,breaks,labels,limits,trans,guide,... See +#' @param name,breaks,labels,limits,trans,guide,...,transform See #' \code{{ggplot2}} documentation for more information on scales. #' #' @return A [ggplot2::Scale] object. @@ -78,14 +78,25 @@ NULL #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = c('stripe', 'crosshatch', 'circle'), - trans = 'identity', guide = 'legend') { - +scale_pattern_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = c('stripe', 'crosshatch', 'circle'), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(choices)) { abort('scale_pattern_continuous(): must specify "choices" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_continuous(trans)', + 'scale_pattern_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern', @@ -94,8 +105,9 @@ scale_pattern_continuous <- function(name = waiver(), breaks = waiver(), labels breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -120,19 +132,29 @@ scale_pattern_discrete <- function(..., choices = c('stripe', 'crosshatch', 'cir ... ) } - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_type_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = NULL, - trans = 'identity', guide = 'legend') { - +scale_pattern_type_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = NULL, + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(choices)) { abort('scale_pattern_type_continuous(): must specify "choices" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_type_continuous(trans)', + 'scale_pattern_type_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_type', @@ -141,8 +163,9 @@ scale_pattern_type_continuous <- function(name = waiver(), breaks = waiver(), la breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -167,19 +190,29 @@ scale_pattern_type_discrete <- function(..., choices = NULL, guide = 'legend') { ... ) } - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_subtype_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = NULL, - trans = 'identity', guide = 'legend') { - +scale_pattern_subtype_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = NULL, + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(choices)) { abort('scale_pattern_subtype_continuous(): must specify "choices" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_subtype_continuous(trans)', + 'scale_pattern_subtype_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_subtype', @@ -188,8 +221,9 @@ scale_pattern_subtype_continuous <- function(name = waiver(), breaks = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -214,23 +248,29 @@ scale_pattern_subtype_discrete <- function(..., choices = NULL, guide = 'legend' ... ) } - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_angle_continuous <- function(name = waiver(), +scale_pattern_angle_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0, 90), - trans = 'identity', - guide = 'legend') { - + range = c(0, 90), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_angle_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_angle_continuous(trans)', + 'scale_pattern_angle_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_angle', @@ -239,8 +279,9 @@ scale_pattern_angle_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -265,18 +306,25 @@ scale_pattern_angle_discrete <- function(..., range = c(0, 90)) { #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_density_continuous <- function(name = waiver(), +scale_pattern_density_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0, 0.5), - trans = 'identity', - guide = 'legend') { - + range = c(0, 0.5), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_density_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_density_continuous(trans)', + 'scale_pattern_density_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_density', @@ -285,8 +333,9 @@ scale_pattern_density_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -311,18 +360,25 @@ scale_pattern_density_discrete <- function(..., range = c(0, 0.5)) { #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_spacing_continuous <- function(name = waiver(), +scale_pattern_spacing_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0.01, 0.1), - trans = 'identity', - guide = 'legend') { - + range = c(0.01, 0.1), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_spacing_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_spacing_continuous(trans)', + 'scale_pattern_spacing_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_spacing', @@ -331,8 +387,9 @@ scale_pattern_spacing_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -357,18 +414,25 @@ scale_pattern_spacing_discrete <- function(..., range = c(0.01, 0.1)) { #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_xoffset_continuous <- function(name = waiver(), +scale_pattern_xoffset_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0.01, 0.1), - trans = 'identity', - guide = 'legend') { - + range = c(0.01, 0.1), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_xoffset_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_xoffset_continuous(trans)', + 'scale_pattern_xoffset_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_xoffset', @@ -377,8 +441,9 @@ scale_pattern_xoffset_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -403,18 +468,25 @@ scale_pattern_xoffset_discrete <- function(..., range = c(0.01, 0.1)) { #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_yoffset_continuous <- function(name = waiver(), +scale_pattern_yoffset_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0.01, 0.1), - trans = 'identity', - guide = 'legend') { - + range = c(0.01, 0.1), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_yoffset_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_yoffset_continuous(trans)', + 'scale_pattern_yoffset_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_yoffset', @@ -423,8 +495,9 @@ scale_pattern_yoffset_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -449,18 +522,25 @@ scale_pattern_yoffset_discrete <- function(..., range = c(0.01, 0.1)) { #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_aspect_ratio_continuous <- function(name = waiver(), +scale_pattern_aspect_ratio_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0.5, 2), - trans = 'identity', - guide = 'legend') { - + range = c(0.5, 2), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_aspect_ratio_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_aspect_ratio_continuous(trans)', + 'scale_pattern_aspect_ratio_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_aspect_ratio', @@ -469,8 +549,9 @@ scale_pattern_aspect_ratio_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -495,18 +576,25 @@ scale_pattern_aspect_ratio_discrete <- function(..., range = c(0.5, 2)) { #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_key_scale_factor_continuous <- function(name = waiver(), +scale_pattern_key_scale_factor_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0.5, 2), - trans = 'identity', - guide = 'legend') { - + range = c(0.5, 2), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_key_scale_factor_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_key_scale_factor_continuous(trans)', + 'scale_pattern_key_scale_factor_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_key_scale_factor', @@ -515,8 +603,9 @@ scale_pattern_key_scale_factor_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -541,14 +630,25 @@ scale_pattern_key_scale_factor_discrete <- function(..., range = c(0.5, 2)) { #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_filename_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = NULL, - trans = 'identity', guide = 'legend') { - +scale_pattern_filename_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = NULL, + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(choices)) { abort('scale_pattern_filename_continuous(): must specify "choices" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_filename_continuous(trans)', + 'scale_pattern_filename_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_filename', @@ -557,8 +657,9 @@ scale_pattern_filename_continuous <- function(name = waiver(), breaks = waiver() breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -583,19 +684,29 @@ scale_pattern_filename_discrete <- function(..., choices = NULL, guide = 'legend ... ) } - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_filter_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = c('lanczos', 'box', 'spline', 'cubic'), - trans = 'identity', guide = 'legend') { - +scale_pattern_filter_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = c('lanczos', 'box', 'spline', 'cubic'), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(choices)) { abort('scale_pattern_filter_continuous(): must specify "choices" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_filter_continuous(trans)', + 'scale_pattern_filter_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_filter', @@ -604,8 +715,9 @@ scale_pattern_filter_continuous <- function(name = waiver(), breaks = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -630,19 +742,29 @@ scale_pattern_filter_discrete <- function(..., choices = c('lanczos', 'box', 'sp ... ) } - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_gravity_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = c('center', 'north', 'south', 'east', 'west', 'northeast', 'northwest', 'southeast', 'southwest'), - trans = 'identity', guide = 'legend') { - +scale_pattern_gravity_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = c('center', 'north', 'south', 'east', 'west', 'northeast', 'northwest', 'southeast', 'southwest'), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(choices)) { abort('scale_pattern_gravity_continuous(): must specify "choices" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_gravity_continuous(trans)', + 'scale_pattern_gravity_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_gravity', @@ -651,8 +773,9 @@ scale_pattern_gravity_continuous <- function(name = waiver(), breaks = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -677,23 +800,29 @@ scale_pattern_gravity_discrete <- function(..., choices = c('center', 'north', ' ... ) } - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_scale_continuous <- function(name = waiver(), +scale_pattern_scale_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0.5, 2), - trans = 'identity', - guide = 'legend') { - + range = c(0.5, 2), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_scale_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_scale_continuous(trans)', + 'scale_pattern_scale_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_scale', @@ -702,8 +831,9 @@ scale_pattern_scale_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -728,14 +858,25 @@ scale_pattern_scale_discrete <- function(..., range = c(0.5, 2)) { #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_orientation_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = c('horizontal', 'vertical', 'radial'), - trans = 'identity', guide = 'legend') { - +scale_pattern_orientation_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = c('horizontal', 'vertical', 'radial'), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(choices)) { abort('scale_pattern_orientation_continuous(): must specify "choices" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_orientation_continuous(trans)', + 'scale_pattern_orientation_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_orientation', @@ -744,8 +885,9 @@ scale_pattern_orientation_continuous <- function(name = waiver(), breaks = waive breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -770,23 +912,29 @@ scale_pattern_orientation_discrete <- function(..., choices = c('horizontal', 'v ... ) } - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_phase_continuous <- function(name = waiver(), +scale_pattern_phase_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = NULL, - trans = 'identity', - guide = 'legend') { - + range = NULL, + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_phase_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_phase_continuous(trans)', + 'scale_pattern_phase_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_phase', @@ -795,8 +943,9 @@ scale_pattern_phase_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -821,18 +970,25 @@ scale_pattern_phase_discrete <- function(..., range = NULL) { #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_frequency_continuous <- function(name = waiver(), +scale_pattern_frequency_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = NULL, - trans = 'identity', - guide = 'legend') { - + range = NULL, + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_frequency_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_frequency_continuous(trans)', + 'scale_pattern_frequency_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_frequency', @@ -841,8 +997,9 @@ scale_pattern_frequency_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -867,14 +1024,25 @@ scale_pattern_frequency_discrete <- function(..., range = NULL) { #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_grid_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = c('square', 'hex'), - trans = 'identity', guide = 'legend') { - +scale_pattern_grid_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = c('square', 'hex'), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(choices)) { abort('scale_pattern_grid_continuous(): must specify "choices" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_grid_continuous(trans)', + 'scale_pattern_grid_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_grid', @@ -883,8 +1051,9 @@ scale_pattern_grid_continuous <- function(name = waiver(), breaks = waiver(), la breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -909,23 +1078,29 @@ scale_pattern_grid_discrete <- function(..., choices = c('square', 'hex'), guide ... ) } - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_res_continuous <- function(name = waiver(), +scale_pattern_res_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = NULL, - trans = 'identity', - guide = 'legend') { - + range = NULL, + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_res_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_res_continuous(trans)', + 'scale_pattern_res_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_res', @@ -934,8 +1109,9 @@ scale_pattern_res_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -960,18 +1136,25 @@ scale_pattern_res_discrete <- function(..., range = NULL) { #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_pattern_rot_continuous <- function(name = waiver(), +scale_pattern_rot_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = c(0, 360), - trans = 'identity', - guide = 'legend') { - + range = c(0, 360), + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') { if (is.null(range)) { abort('scale_pattern_rot_continuous(): must specify "range" argument') } + if (lifecycle::is_present(trans)) { + lifecycle::deprecate_warn('1.1.1', + 'scale_pattern_rot_continuous(trans)', + 'scale_pattern_rot_continuous(transform)') + transform <- trans + } ggplot2::continuous_scale( aesthetics = 'pattern_rot', @@ -980,8 +1163,9 @@ scale_pattern_rot_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/R/zzz.R b/R/zzz.R index a7f8bb2..3508331 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,4 +1,5 @@ #' @import ggplot2 glue grid rlang scales +#' @importFrom lifecycle deprecated #' @importFrom stats setNames #' @importFrom utils tail #' @importFrom grDevices col2rgb dev.off png rgb diff --git a/data-raw/config.R b/data-raw/config.R index 412ce60..f55ce45 100644 --- a/data-raw/config.R +++ b/data-raw/config.R @@ -1,5 +1,3 @@ - - ggpattern_aes <-readr::read_delim( "aes_name | ggplot_name | aes_type | scale_default pattern | | discrete | c('stripe', 'crosshatch', 'circle') @@ -36,5 +34,3 @@ pattern_grid | | discrete | c('square', 'hex') pattern_res | | continuous | NULL pattern_rot | | continuous | c(0, 360) ", trim_ws = TRUE, delim = "|") - - diff --git a/data-raw/generate-scales-continuous-discrete.R b/data-raw/generate-scales-continuous-discrete.R index 6f17976..7ba9cb5 100644 --- a/data-raw/generate-scales-continuous-discrete.R +++ b/data-raw/generate-scales-continuous-discrete.R @@ -1,13 +1,13 @@ suppressPackageStartupMessages({ - library(dplyr) - library(glue) + library("dplyr") + library("glue") }) template_cont_roxygen_first <- " #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' Scales for continuous pattern aesthetics #' -#' @param name,breaks,labels,limits,range,trans,guide,... See +#' @param name,breaks,labels,limits,range,trans,guide,...,transform See #' \\code{{ggplot2}} documentation for more information on scales. #' #' @return A [ggplot2::Scale] object. @@ -45,18 +45,25 @@ template_cont_var_cont_aes <- " #' @rdname scale_continuous #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_{aes_name}_continuous <- function(name = waiver(), +scale_{aes_name}_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, - range = {scale_default}, - trans = 'identity', - guide = 'legend') {{ - + range = {scale_default}, + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') {{ if (is.null(range)) {{ abort('scale_{aes_name}_continuous(): must specify \"range\" argument') }} + if (lifecycle::is_present(trans)) {{ + lifecycle::deprecate_warn('1.1.1', + 'scale_{aes_name}_continuous(trans)', + 'scale_{aes_name}_continuous(transform)') + transform <- trans + }} ggplot2::continuous_scale( aesthetics = '{aes_name}', @@ -65,8 +72,9 @@ scale_{aes_name}_continuous <- function(name = waiver(), breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide + transform = transform, + guide = guide, + ... ) }} @@ -99,7 +107,7 @@ template_discrete_roxygen_first <- " #' Scales for discrete pattern aesthetics #' #' @param choices vector of values to choose from. -#' @param name,breaks,labels,limits,trans,guide,... See +#' @param name,breaks,labels,limits,trans,guide,...,transform See #' \\code{{ggplot2}} documentation for more information on scales. #' #' @return A [ggplot2::Scale] object. @@ -134,14 +142,25 @@ template_cont_var_discrete_aes <- " #' @rdname scale_discrete #' @export #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -scale_{aes_name}_continuous <- function(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, choices = {scale_default}, - trans = 'identity', guide = 'legend') {{ - +scale_{aes_name}_continuous <- function(name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + choices = {scale_default}, + trans = deprecated(), + guide = 'legend', + ..., + transform = 'identity') {{ if (is.null(choices)) {{ abort('scale_{aes_name}_continuous(): must specify \"choices\" argument') }} + if (lifecycle::is_present(trans)) {{ + lifecycle::deprecate_warn('1.1.1', + 'scale_{aes_name}_continuous(trans)', + 'scale_{aes_name}_continuous(transform)') + transform <- trans + }} ggplot2::continuous_scale( aesthetics = '{aes_name}', @@ -150,8 +169,9 @@ scale_{aes_name}_continuous <- function(name = waiver(), breaks = waiver(), labe breaks = breaks, labels = labels, limits = limits, - trans = trans, - guide = guide) + transform = transform, + guide = guide, + ...) }} @@ -181,11 +201,8 @@ scale_{aes_name}_discrete <- function(..., choices = {scale_default}, guide = 'l ) }} - " - - source("data-raw/config.R") # sink("R/scale-pattern.R") @@ -211,12 +228,3 @@ for (i in seq(nrow(ggpattern_aes))) { } # sink() - - - - - - - - - diff --git a/data-raw/generate-scales.R b/data-raw/generate-scales.R index 940a8fc..ea228bd 100644 --- a/data-raw/generate-scales.R +++ b/data-raw/generate-scales.R @@ -1,10 +1,8 @@ - suppressPackageStartupMessages({ - library(dplyr) - library(glue) + library("dplyr") + library("glue") }) - sink("R/scale-pattern.R") cat("#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n") @@ -18,10 +16,4 @@ source("data-raw/generate-scales-continuous-discrete.R") source("data-raw/generate-scales-manual.R") source("data-raw/generate-scales-identity.R") - sink() - - - - - diff --git a/man/scale_continuous.Rd b/man/scale_continuous.Rd index cc0516e..3edd639 100644 --- a/man/scale_continuous.Rd +++ b/man/scale_continuous.Rd @@ -34,8 +34,10 @@ scale_pattern_angle_continuous( labels = waiver(), limits = NULL, range = c(0, 90), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_angle_discrete(..., range = c(0, 90)) @@ -46,8 +48,10 @@ scale_pattern_density_continuous( labels = waiver(), limits = NULL, range = c(0, 0.5), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_density_discrete(..., range = c(0, 0.5)) @@ -58,8 +62,10 @@ scale_pattern_spacing_continuous( labels = waiver(), limits = NULL, range = c(0.01, 0.1), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_spacing_discrete(..., range = c(0.01, 0.1)) @@ -70,8 +76,10 @@ scale_pattern_xoffset_continuous( labels = waiver(), limits = NULL, range = c(0.01, 0.1), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_xoffset_discrete(..., range = c(0.01, 0.1)) @@ -82,8 +90,10 @@ scale_pattern_yoffset_continuous( labels = waiver(), limits = NULL, range = c(0.01, 0.1), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_yoffset_discrete(..., range = c(0.01, 0.1)) @@ -94,8 +104,10 @@ scale_pattern_aspect_ratio_continuous( labels = waiver(), limits = NULL, range = c(0.5, 2), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_aspect_ratio_discrete(..., range = c(0.5, 2)) @@ -106,8 +118,10 @@ scale_pattern_key_scale_factor_continuous( labels = waiver(), limits = NULL, range = c(0.5, 2), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_key_scale_factor_discrete(..., range = c(0.5, 2)) @@ -118,8 +132,10 @@ scale_pattern_scale_continuous( labels = waiver(), limits = NULL, range = c(0.5, 2), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_scale_discrete(..., range = c(0.5, 2)) @@ -130,8 +146,10 @@ scale_pattern_phase_continuous( labels = waiver(), limits = NULL, range = NULL, - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_phase_discrete(..., range = NULL) @@ -142,8 +160,10 @@ scale_pattern_frequency_continuous( labels = waiver(), limits = NULL, range = NULL, - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_frequency_discrete(..., range = NULL) @@ -154,8 +174,10 @@ scale_pattern_res_continuous( labels = waiver(), limits = NULL, range = NULL, - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_res_discrete(..., range = NULL) @@ -166,14 +188,16 @@ scale_pattern_rot_continuous( labels = waiver(), limits = NULL, range = c(0, 360), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_rot_discrete(..., range = c(0, 360)) } \arguments{ -\item{name, breaks, labels, limits, range, trans, guide, ...}{See +\item{name, breaks, labels, limits, range, trans, guide, ..., transform}{See \code{{ggplot2}} documentation for more information on scales.} } \value{ diff --git a/man/scale_discrete.Rd b/man/scale_discrete.Rd index 8e030bd..7068ff9 100644 --- a/man/scale_discrete.Rd +++ b/man/scale_discrete.Rd @@ -26,8 +26,10 @@ scale_pattern_continuous( labels = waiver(), limits = NULL, choices = c("stripe", "crosshatch", "circle"), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_discrete( @@ -42,8 +44,10 @@ scale_pattern_type_continuous( labels = waiver(), limits = NULL, choices = NULL, - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_type_discrete(..., choices = NULL, guide = "legend") @@ -54,8 +58,10 @@ scale_pattern_subtype_continuous( labels = waiver(), limits = NULL, choices = NULL, - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_subtype_discrete(..., choices = NULL, guide = "legend") @@ -66,8 +72,10 @@ scale_pattern_filename_continuous( labels = waiver(), limits = NULL, choices = NULL, - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_filename_discrete(..., choices = NULL, guide = "legend") @@ -78,8 +86,10 @@ scale_pattern_filter_continuous( labels = waiver(), limits = NULL, choices = c("lanczos", "box", "spline", "cubic"), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_filter_discrete( @@ -95,8 +105,10 @@ scale_pattern_gravity_continuous( limits = NULL, choices = c("center", "north", "south", "east", "west", "northeast", "northwest", "southeast", "southwest"), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_gravity_discrete( @@ -112,8 +124,10 @@ scale_pattern_orientation_continuous( labels = waiver(), limits = NULL, choices = c("horizontal", "vertical", "radial"), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_orientation_discrete( @@ -128,8 +142,10 @@ scale_pattern_grid_continuous( labels = waiver(), limits = NULL, choices = c("square", "hex"), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_grid_discrete( @@ -139,7 +155,7 @@ scale_pattern_grid_discrete( ) } \arguments{ -\item{name, breaks, labels, limits, trans, guide, ...}{See +\item{name, breaks, labels, limits, trans, guide, ..., transform}{See \code{{ggplot2}} documentation for more information on scales.} \item{choices}{vector of values to choose from.} diff --git a/man/scale_pattern_size_continuous.Rd b/man/scale_pattern_size_continuous.Rd index f71ccb4..ceb4d2c 100644 --- a/man/scale_pattern_size_continuous.Rd +++ b/man/scale_pattern_size_continuous.Rd @@ -13,8 +13,10 @@ scale_pattern_size_continuous( labels = waiver(), limits = NULL, range = c(1, 6), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) scale_pattern_size( @@ -23,12 +25,14 @@ scale_pattern_size( labels = waiver(), limits = NULL, range = c(1, 6), - trans = "identity", - guide = "legend" + trans = deprecated(), + guide = "legend", + ..., + transform = "identity" ) } \arguments{ -\item{name, breaks, labels, limits, trans, guide}{See \code{ggplot2::scale_size} for more information} +\item{name, breaks, labels, limits, trans, guide, ..., transform}{See \code{\link[ggplot2:scale_size]{ggplot2::scale_size()}} for more information} \item{range}{a numeric vector of length 2 that specifies the minimum and maximum size of the plotting symbol after transformation.}