Skip to content

Commit ed978ab

Browse files
committed
included functions to warn if the user supplies either the mapping or data
1 parent 8b0f58a commit ed978ab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

R/stat-function.r

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ stat_function <- function(mapping = NULL, data = NULL,
8181
...
8282
)
8383
)
84+
85+
# Warn if supplied mapping and/or data is going to be overwritten
86+
if (!is.null(mapping)) {
87+
warn_overwritten_args("stat_function()", "mapping", "group")
88+
}
89+
if (!is.null(data)) {
90+
warn_overwritten_args("stat_function()", "data", "group")
91+
}
92+
93+
8494
}
8595

8696
#' @rdname ggplot2-ggproto

0 commit comments

Comments
 (0)