Skip to content

Commit 035e6ff

Browse files
committed
Ensure stat_identity has default na.rm argument.
Slightly improve docs as well
1 parent fa09e1a commit 035e6ff

File tree

7 files changed

+21
-8
lines changed

7 files changed

+21
-8
lines changed

R/stat-ecdf.r

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#' Empirical Cumulative Density Function
22
#'
33
#' @inheritParams stat_identity
4+
#' @param na.rm If \code{FALSE} (the default), removes missing values with
5+
#' a warning. If \code{TRUE} silently removes missing values.
46
#' @param n if NULL, do not interpolate. If not NULL, this is the number
57
#' of points to interpolate with.
68
#' @section Computed variables:

R/stat-ellipse.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#' representing the euclidean distance from the center.
1616
#' This ellipse probably won't appear circular unless \code{coord_fixed()} is applied.
1717
#' @param segments The number of segments to be used in drawing the ellipse.
18+
#' @param na.rm If \code{FALSE} (the default), removes missing values with
19+
#' a warning. If \code{TRUE} silently removes missing values.
1820
#' @inheritParams stat_identity
1921
#' @export
2022
#' @examples

R/stat-function.r

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#' @param fun function to use
77
#' @param n number of points to interpolate along
88
#' @param args list of additional arguments to pass to \code{fun}
9+
#' @param na.rm If \code{FALSE} (the default), removes missing values with
10+
#' a warning. If \code{TRUE} silently removes missing values.
911
#' @inheritParams stat_identity
1012
#' @section Computed variables:
1113
#' \describe{

R/stat-identity.r

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#' @param ... other arguments passed on to \code{\link{layer}}. This can
2121
#' include aesthetics whose values you want to set, not map. See
2222
#' \code{\link{layer}} for more details.
23-
#' @param na.rm If \code{FALSE} (the default), removes missing values with
24-
#' a warning. If \code{TRUE} silently removes missing values.
25-
#' @keywords internal
2623
#' @export
24+
#' @examples
25+
#' p <- ggplot(mtcars, aes(wt, mpg))
26+
#' p + stat_identity()
2727
stat_identity <- function(mapping = NULL, data = NULL, geom = "point",
2828
position = "identity", show.legend = NA,
2929
inherit.aes = TRUE, ...) {
@@ -35,7 +35,10 @@ stat_identity <- function(mapping = NULL, data = NULL, geom = "point",
3535
position = position,
3636
show.legend = show.legend,
3737
inherit.aes = inherit.aes,
38-
params = list(...)
38+
params = list(
39+
na.rm = FALSE,
40+
...
41+
)
3942
)
4043
}
4144

R/stat-qq.r

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#' @param distribution Distribution function to use, if x not specified
77
#' @param dparams Additional parameters passed on to \code{distribution}
88
#' function.
9+
#' @param na.rm If \code{FALSE} (the default), removes missing values with
10+
#' a warning. If \code{TRUE} silently removes missing values.
911
#' @inheritParams stat_identity
1012
#' @section Computed variables:
1113
#' \describe{

R/stat-unique.r

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#'
66
#' @export
77
#' @inheritParams stat_identity
8+
#' @param na.rm If \code{FALSE} (the default), removes missing values with
9+
#' a warning. If \code{TRUE} silently removes missing values.
810
#' @examples
911
#' ggplot(mtcars, aes(vs, am)) + geom_point(alpha = 0.1)
1012
#' ggplot(mtcars, aes(vs, am)) + geom_point(alpha = 0.1, stat="unique")

man/stat_identity.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)