diff --git a/NEWS.md b/NEWS.md index adaaf04f..f74a4e7f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -35,8 +35,9 @@ search of transformations. The S3 class of transformations has been renamed from `"trans"` to `"transform"`. `new_transform()` is the new `trans_new()`. +* Palette functions now have the `pal_`-prefix. The old `_pal`-suffixed versions + are kept for backward compatibility. - # scales 1.2.1 * Re-document to fix HTML issues in `.Rd`. diff --git a/R/documentation.R b/R/documentation.R index 8669f7b3..0442f01b 100644 --- a/R/documentation.R +++ b/R/documentation.R @@ -9,4 +9,4 @@ seealso <- function(pattern) { seealso_transform <- function() seealso("^transform_") -seealso_pal <- function() seealso("_pal$") +seealso_pal <- function() seealso("^pal_") diff --git a/R/pal-shape.R b/R/pal-shape.r similarity index 100% rename from R/pal-shape.R rename to R/pal-shape.r diff --git a/R/scale-continuous.R b/R/scale-continuous.R index e687937c..102b325f 100644 --- a/R/scale-continuous.R +++ b/R/scale-continuous.R @@ -14,11 +14,11 @@ #' \Sexpr[results=rd,stage=build]{scales:::seealso_transform()}. #' @export #' @examples -#' with(mtcars, plot(disp, mpg, cex = cscale(hp, rescale_pal()))) -#' with(mtcars, plot(disp, mpg, cex = cscale(hp, rescale_pal(), +#' with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_rescale()))) +#' with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_rescale(), #' trans = transform_sqrt() #' ))) -#' with(mtcars, plot(disp, mpg, cex = cscale(hp, area_pal()))) +#' with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_area()))) #' with(mtcars, plot(disp, mpg, #' pch = 20, cex = 5, #' col = cscale(hp, pal_seq_gradient("grey80", "black")) diff --git a/man/cscale.Rd b/man/cscale.Rd index 001520bd..2ff6f969 100644 --- a/man/cscale.Rd +++ b/man/cscale.Rd @@ -27,11 +27,11 @@ Built in transformations: Continuous scale } \examples{ -with(mtcars, plot(disp, mpg, cex = cscale(hp, rescale_pal()))) -with(mtcars, plot(disp, mpg, cex = cscale(hp, rescale_pal(), +with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_rescale()))) +with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_rescale(), trans = transform_sqrt() ))) -with(mtcars, plot(disp, mpg, cex = cscale(hp, area_pal()))) +with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_area()))) with(mtcars, plot(disp, mpg, pch = 20, cex = 5, col = cscale(hp, pal_seq_gradient("grey80", "black"))