From d7f36f40bb28b41558989d0338d8263ccabbd49b Mon Sep 17 00:00:00 2001 From: Catherine Gitau Date: Mon, 8 Jul 2019 12:44:41 +0300 Subject: [PATCH 1/5] added link to scales::squish and scales::squish_infinite in the oob documentation --- R/scale-.r | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/scale-.r b/R/scale-.r index 7e51852dc9..c4eb117011 100644 --- a/R/scale-.r +++ b/R/scale-.r @@ -45,7 +45,9 @@ #' scales, which ways use [scales::rescale()]. #' @param oob Function that handles limits outside of the scale limits #' (out of bounds). The default ([scales::censor()]) replaces out of -#' bounds values with `NA`. +#' bounds values with `NA`. ([scales::squish()]) can also be used, +#' which squish the out-of-bounds values into range and +#' ([scales::squish_infinite()]) which squish infinite values into range. #' @param na.value Missing values will be replaced with this value. #' @param trans For continuous scales, the name of a transformation object #' or the object itself. Built-in transformations include "asn", "atanh", From ccf14cb9f5c8fb0b3a9f86b43e876e77971e54e9 Mon Sep 17 00:00:00 2001 From: Catherine Gitau Date: Mon, 8 Jul 2019 16:44:01 +0300 Subject: [PATCH 2/5] changed the docs into bulleted points --- R/scale-.r | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/R/scale-.r b/R/scale-.r index c4eb117011..3b7f10046f 100644 --- a/R/scale-.r +++ b/R/scale-.r @@ -43,11 +43,22 @@ #' diverging and n colour gradients (i.e., [scale_colour_gradient2()], #' [scale_colour_gradientn()]). The `rescaler` is ignored by position #' scales, which ways use [scales::rescale()]. +<<<<<<< Updated upstream #' @param oob Function that handles limits outside of the scale limits #' (out of bounds). The default ([scales::censor()]) replaces out of #' bounds values with `NA`. ([scales::squish()]) can also be used, #' which squish the out-of-bounds values into range and #' ([scales::squish_infinite()]) which squish infinite values into range. +======= +#' @param oob One of: +#' - Function that handles limits outside of the scale limits +#' (out of bounds). +#' - The default ([scales::censor()]) replaces out of +#' bounds values with `NA`. +#' - [scales::squish()] for squishing out of bounds values into range. +#' - [scales::squish_infinite()] for squishing infitite values to range. +#' +>>>>>>> Stashed changes #' @param na.value Missing values will be replaced with this value. #' @param trans For continuous scales, the name of a transformation object #' or the object itself. Built-in transformations include "asn", "atanh", From a9c0a378a77d4bbe0d2f0fd7e6c5b260d4cf5796 Mon Sep 17 00:00:00 2001 From: Catherine Gitau Date: Mon, 8 Jul 2019 16:46:20 +0300 Subject: [PATCH 3/5] changed the docs into bulleted points --- R/scale-.r | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/R/scale-.r b/R/scale-.r index 3b7f10046f..11ced2b2ef 100644 --- a/R/scale-.r +++ b/R/scale-.r @@ -43,22 +43,13 @@ #' diverging and n colour gradients (i.e., [scale_colour_gradient2()], #' [scale_colour_gradientn()]). The `rescaler` is ignored by position #' scales, which ways use [scales::rescale()]. -<<<<<<< Updated upstream -#' @param oob Function that handles limits outside of the scale limits -#' (out of bounds). The default ([scales::censor()]) replaces out of -#' bounds values with `NA`. ([scales::squish()]) can also be used, -#' which squish the out-of-bounds values into range and -#' ([scales::squish_infinite()]) which squish infinite values into range. -======= #' @param oob One of: #' - Function that handles limits outside of the scale limits #' (out of bounds). #' - The default ([scales::censor()]) replaces out of #' bounds values with `NA`. #' - [scales::squish()] for squishing out of bounds values into range. -#' - [scales::squish_infinite()] for squishing infitite values to range. -#' ->>>>>>> Stashed changes +#' - [scales::squish_infinite()] for squishing infitite values into range. #' @param na.value Missing values will be replaced with this value. #' @param trans For continuous scales, the name of a transformation object #' or the object itself. Built-in transformations include "asn", "atanh", From 5d5213eb77c7c4d6fca81eb33fdda706ec27fbc0 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Tue, 16 Jul 2019 13:11:18 -0400 Subject: [PATCH 4/5] Run devtools::document() to update .Rd files --- man/continuous_scale.Rd | 12 +++++++++--- man/scale_continuous.Rd | 12 +++++++++--- man/scale_date.Rd | 12 +++++++++--- man/scale_gradient.Rd | 12 +++++++++--- man/scale_size.Rd | 12 +++++++++--- 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/man/continuous_scale.Rd b/man/continuous_scale.Rd index 6fcf161e52..1e34003bc2 100644 --- a/man/continuous_scale.Rd +++ b/man/continuous_scale.Rd @@ -69,9 +69,15 @@ diverging and n colour gradients (i.e., \code{\link[=scale_colour_gradient2]{sca \code{\link[=scale_colour_gradientn]{scale_colour_gradientn()}}). The \code{rescaler} is ignored by position scales, which ways use \code{\link[scales:rescale]{scales::rescale()}}.} -\item{oob}{Function that handles limits outside of the scale limits -(out of bounds). The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of -bounds values with \code{NA}.} +\item{oob}{One of: +\itemize{ +\item Function that handles limits outside of the scale limits +(out of bounds). +\item The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of +bounds values with \code{NA}. +\item \code{\link[scales:squish]{scales::squish()}} for squishing out of bounds values into range. +\item \code{\link[scales:squish_infinite]{scales::squish_infinite()}} for squishing infitite values into range. +}} \item{expand}{For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance diff --git a/man/scale_continuous.Rd b/man/scale_continuous.Rd index ca74e2ad5e..5398e1dc40 100644 --- a/man/scale_continuous.Rd +++ b/man/scale_continuous.Rd @@ -84,9 +84,15 @@ to generate the values for the \code{expand} argument. The defaults are to expand the scale by 5\% on each side for continuous variables, and by 0.6 units on each side for discrete variables.} -\item{oob}{Function that handles limits outside of the scale limits -(out of bounds). The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of -bounds values with \code{NA}.} +\item{oob}{One of: +\itemize{ +\item Function that handles limits outside of the scale limits +(out of bounds). +\item The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of +bounds values with \code{NA}. +\item \code{\link[scales:squish]{scales::squish()}} for squishing out of bounds values into range. +\item \code{\link[scales:squish_infinite]{scales::squish_infinite()}} for squishing infitite values into range. +}} \item{na.value}{Missing values will be replaced with this value.} diff --git a/man/scale_date.Rd b/man/scale_date.Rd index a48f8b01d4..4a026b5529 100644 --- a/man/scale_date.Rd +++ b/man/scale_date.Rd @@ -112,9 +112,15 @@ expand the scale by 5\% on each side for continuous variables, and by \item{timezone}{The timezone to use for display on the axes. The default (\code{NULL}) uses the timezone encoded in the data.} -\item{oob}{Function that handles limits outside of the scale limits -(out of bounds). The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of -bounds values with \code{NA}.} +\item{oob}{One of: +\itemize{ +\item Function that handles limits outside of the scale limits +(out of bounds). +\item The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of +bounds values with \code{NA}. +\item \code{\link[scales:squish]{scales::squish()}} for squishing out of bounds values into range. +\item \code{\link[scales:squish_infinite]{scales::squish_infinite()}} for squishing infitite values into range. +}} \item{na.value}{Missing values will be replaced with this value.} } diff --git a/man/scale_gradient.Rd b/man/scale_gradient.Rd index a69dcdf485..c8e17d9ad6 100644 --- a/man/scale_gradient.Rd +++ b/man/scale_gradient.Rd @@ -92,9 +92,15 @@ range [0, 1]. This is always \code{\link[scales:rescale]{scales::rescale()}}, ex diverging and n colour gradients (i.e., \code{\link[=scale_colour_gradient2]{scale_colour_gradient2()}}, \code{\link[=scale_colour_gradientn]{scale_colour_gradientn()}}). The \code{rescaler} is ignored by position scales, which ways use \code{\link[scales:rescale]{scales::rescale()}}.} - \item{oob}{Function that handles limits outside of the scale limits -(out of bounds). The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of -bounds values with \code{NA}.} + \item{oob}{One of: +\itemize{ +\item Function that handles limits outside of the scale limits +(out of bounds). +\item The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of +bounds values with \code{NA}. +\item \code{\link[scales:squish]{scales::squish()}} for squishing out of bounds values into range. +\item \code{\link[scales:squish_infinite]{scales::squish_infinite()}} for squishing infitite values into range. +}} \item{trans}{For continuous scales, the name of a transformation object or the object itself. Built-in transformations include "asn", "atanh", "boxcox", "date", "exp", "hms", "identity", "log", "log10", "log1p", "log2", diff --git a/man/scale_size.Rd b/man/scale_size.Rd index 43a284863e..7683c5b36f 100644 --- a/man/scale_size.Rd +++ b/man/scale_size.Rd @@ -114,9 +114,15 @@ Use \code{NA} to refer to the existing minimum or maximum \item A function that accepts the existing (automatic) limits and returns new limits }} - \item{oob}{Function that handles limits outside of the scale limits -(out of bounds). The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of -bounds values with \code{NA}.} + \item{oob}{One of: +\itemize{ +\item Function that handles limits outside of the scale limits +(out of bounds). +\item The default (\code{\link[scales:censor]{scales::censor()}}) replaces out of +bounds values with \code{NA}. +\item \code{\link[scales:squish]{scales::squish()}} for squishing out of bounds values into range. +\item \code{\link[scales:squish_infinite]{scales::squish_infinite()}} for squishing infitite values into range. +}} \item{na.value}{Missing values will be replaced with this value.} \item{trans}{For continuous scales, the name of a transformation object or the object itself. Built-in transformations include "asn", "atanh", From 188be23159da81f317f34b8edb14d51e11c7cd4c Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Tue, 16 Jul 2019 13:18:39 -0400 Subject: [PATCH 5/5] Make sure previously updated limits documentation is included in the PR --- R/scale-.r | 3 +++ man/continuous_scale.Rd | 3 +++ man/scale_continuous.Rd | 3 +++ man/scale_date.Rd | 3 +++ man/scale_gradient.Rd | 3 +++ man/scale_size.Rd | 6 ++++++ 6 files changed, 21 insertions(+) diff --git a/R/scale-.r b/R/scale-.r index 11ced2b2ef..9ccd77b42d 100644 --- a/R/scale-.r +++ b/R/scale-.r @@ -38,6 +38,9 @@ #' Use `NA` to refer to the existing minimum or maximum #' - A function that accepts the existing (automatic) limits and returns #' new limits +#' Note that setting limits on positional scales will **remove** data outside of the limits. +#' If the purpose is to zoom, use the limit argument in the coordinate system +#' (see [coord_cartesian()]). #' @param rescaler A function used to scale the input values to the #' range \[0, 1]. This is always [scales::rescale()], except for #' diverging and n colour gradients (i.e., [scale_colour_gradient2()], diff --git a/man/continuous_scale.Rd b/man/continuous_scale.Rd index 1e34003bc2..6c5ee2a3fb 100644 --- a/man/continuous_scale.Rd +++ b/man/continuous_scale.Rd @@ -61,6 +61,9 @@ as output Use \code{NA} to refer to the existing minimum or maximum \item A function that accepts the existing (automatic) limits and returns new limits +Note that setting limits on positional scales will \strong{remove} data outside of the limits. +If the purpose is to zoom, use the limit argument in the coordinate system +(see \code{\link[=coord_cartesian]{coord_cartesian()}}). }} \item{rescaler}{A function used to scale the input values to the diff --git a/man/scale_continuous.Rd b/man/scale_continuous.Rd index 5398e1dc40..ef810c005f 100644 --- a/man/scale_continuous.Rd +++ b/man/scale_continuous.Rd @@ -75,6 +75,9 @@ as output Use \code{NA} to refer to the existing minimum or maximum \item A function that accepts the existing (automatic) limits and returns new limits +Note that setting limits on positional scales will \strong{remove} data outside of the limits. +If the purpose is to zoom, use the limit argument in the coordinate system +(see \code{\link[=coord_cartesian]{coord_cartesian()}}). }} \item{expand}{For position scales, a vector of range expansion constants used to add some diff --git a/man/scale_date.Rd b/man/scale_date.Rd index 4a026b5529..26c0f32b8d 100644 --- a/man/scale_date.Rd +++ b/man/scale_date.Rd @@ -95,6 +95,9 @@ like "2 weeks", or "10 years". If both \code{minor_breaks} and Use \code{NA} to refer to the existing minimum or maximum \item A function that accepts the existing (automatic) limits and returns new limits +Note that setting limits on positional scales will \strong{remove} data outside of the limits. +If the purpose is to zoom, use the limit argument in the coordinate system +(see \code{\link[=coord_cartesian]{coord_cartesian()}}). }} \item{expand}{For position scales, a vector of range expansion constants used to add some diff --git a/man/scale_gradient.Rd b/man/scale_gradient.Rd index c8e17d9ad6..36566deb03 100644 --- a/man/scale_gradient.Rd +++ b/man/scale_gradient.Rd @@ -86,6 +86,9 @@ as output Use \code{NA} to refer to the existing minimum or maximum \item A function that accepts the existing (automatic) limits and returns new limits +Note that setting limits on positional scales will \strong{remove} data outside of the limits. +If the purpose is to zoom, use the limit argument in the coordinate system +(see \code{\link[=coord_cartesian]{coord_cartesian()}}). }} \item{rescaler}{A function used to scale the input values to the range [0, 1]. This is always \code{\link[scales:rescale]{scales::rescale()}}, except for diff --git a/man/scale_size.Rd b/man/scale_size.Rd index 7683c5b36f..17614721fc 100644 --- a/man/scale_size.Rd +++ b/man/scale_size.Rd @@ -54,6 +54,9 @@ as output Use \code{NA} to refer to the existing minimum or maximum \item A function that accepts the existing (automatic) limits and returns new limits +Note that setting limits on positional scales will \strong{remove} data outside of the limits. +If the purpose is to zoom, use the limit argument in the coordinate system +(see \code{\link[=coord_cartesian]{coord_cartesian()}}). }} \item{range}{a numeric vector of length 2 that specifies the minimum and @@ -113,6 +116,9 @@ as output Use \code{NA} to refer to the existing minimum or maximum \item A function that accepts the existing (automatic) limits and returns new limits +Note that setting limits on positional scales will \strong{remove} data outside of the limits. +If the purpose is to zoom, use the limit argument in the coordinate system +(see \code{\link[=coord_cartesian]{coord_cartesian()}}). }} \item{oob}{One of: \itemize{