Skip to content

Commit 83c8123

Browse files
authored
add warning in lims docs about values outside of limits being removed from data (#3789)
* improve lims docs: add warning about values outside of limits being removed from data, references #3752 * place lim warning in first paragraph, references #3752 * rerun roxygen, references #3752
1 parent 8bc39f2 commit 83c8123

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

R/limits.r

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#' Set scale limits
22
#'
3-
#' This is a shortcut for supplying the `limits` argument to the
4-
#' individual scales. Note that, by default, any values outside the limits
5-
#' will be replaced with `NA`.
3+
#' This is a shortcut for supplying the `limits` argument to the individual
4+
#' scales. By default, any values outside the limits specified are replaced with
5+
#' `NA`. Be warned that this will remove data outside the limits and this can
6+
#' produce unintended results. For changing x or y axis limits \strong{without}
7+
#' dropping data observations, see [coord_cartesian()].
68
#'
79
#' @param ... For `xlim()` and `ylim()`: Two numeric values, specifying the left/lower
810
#' limit and the right/upper limit of the scale. If the larger value is given first,
@@ -17,10 +19,9 @@
1719
#' A character or factor value will create a discrete scale.
1820
#' A date-time value will create a continuous date/time scale.
1921
#'
20-
#' @seealso For changing x or y axis limits \strong{without} dropping data
21-
#' observations, see [coord_cartesian()]. To expand the range of
22-
#' a plot to always include certain values, see [expand_limits()]. For other
23-
#' types of data, see [scale_x_discrete()], [scale_x_continuous()], [scale_x_date()].
22+
#' @seealso To expand the range of a plot to always include
23+
#' certain values, see [expand_limits()]. For other types of data, see
24+
#' [scale_x_discrete()], [scale_x_continuous()], [scale_x_date()].
2425
#'
2526
#' @export
2627
#' @examples

man/lims.Rd

+8-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)