Skip to content

Commit fa3cd8f

Browse files
yutannihilationclauswilke
authored andcommitted
Improve error messages about conflicted parameters (#2854)
* Improve error messages about conflicted parameters * Use "must" for error messages * Add periods * Address comments * Add a missing period
1 parent 484a220 commit fa3cd8f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

R/geom-jitter.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ geom_jitter <- function(mapping = NULL, data = NULL,
3939
inherit.aes = TRUE) {
4040
if (!missing(width) || !missing(height)) {
4141
if (!missing(position)) {
42-
stop("Specify either `position` or `width`/`height`", call. = FALSE)
42+
stop("You must specify either `position` or `width`/`height`.", call. = FALSE)
4343
}
4444

4545
position <- position_jitter(width = width, height = height)

R/geom-label.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ geom_label <- function(mapping = NULL, data = NULL,
1717
inherit.aes = TRUE) {
1818
if (!missing(nudge_x) || !missing(nudge_y)) {
1919
if (!missing(position)) {
20-
stop("Specify either `position` or `nudge_x`/`nudge_y`", call. = FALSE)
20+
stop("You must specify either `position` or `nudge_x`/`nudge_y`.", call. = FALSE)
2121
}
2222

2323
position <- position_nudge(nudge_x, nudge_y)

R/geom-text.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ geom_text <- function(mapping = NULL, data = NULL,
136136
{
137137
if (!missing(nudge_x) || !missing(nudge_y)) {
138138
if (!missing(position)) {
139-
stop("Specify either `position` or `nudge_x`/`nudge_y`", call. = FALSE)
139+
stop("You must specify either `position` or `nudge_x`/`nudge_y`.", call. = FALSE)
140140
}
141141

142142
position <- position_nudge(nudge_x, nudge_y)

R/sf.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ geom_sf_text <- function(mapping = aes(), data = NULL,
347347

348348
if (!missing(nudge_x) || !missing(nudge_y)) {
349349
if (!missing(position)) {
350-
stop("Specify either `position` or `nudge_x`/`nudge_y`", call. = FALSE)
350+
stop("You must specify either `position` or `nudge_x`/`nudge_y`.", call. = FALSE)
351351
}
352352

353353
position <- position_nudge(nudge_x, nudge_y)

0 commit comments

Comments
 (0)