Skip to content

Commit a5ea5a6

Browse files
committed
Avoid confusion in warning messages
The actual function call from which the warning is emitted might not be that helpful to the casual user.
1 parent 448d78e commit a5ea5a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/scale-brewer.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ scale_colour_distiller <- function(..., type = "seq", palette = 1, values = NULL
7171
# warn about using a qualitative brewer palette to generate the gradient
7272
type <- match.arg(type, c("seq", "div", "qual"))
7373
if (type == "qual") {
74-
warning("Using a discrete colour palette in a continuous scale.\n Consider using type = \"seq\" or type = \"div\" instead")
74+
warning("Using a discrete colour palette in a continuous scale.\n Consider using type = \"seq\" or type = \"div\" instead", call. = FALSE)
7575
}
7676
continuous_scale("colour", "distiller",
7777
gradient_n_pal(brewer_pal(type, palette)(6), values, space), na.value = na.value, ...)
@@ -83,7 +83,7 @@ scale_colour_distiller <- function(..., type = "seq", palette = 1, values = NULL
8383
scale_fill_distiller <- function(..., type = "seq", palette = 1, values = NULL, space = "Lab", na.value = "grey50") {
8484
type <- match.arg(type, c("seq", "div", "qual"))
8585
if (type == "qual") {
86-
warning("Using a discrete colour palette in a continuous scale.\n Consider using type = \"seq\" or type = \"div\" instead")
86+
warning("Using a discrete colour palette in a continuous scale.\n Consider using type = \"seq\" or type = \"div\" instead", call. = FALSE)
8787
}
8888
continuous_scale("fill", "distiller",
8989
gradient_n_pal(brewer_pal(type, palette)(6), values, space), na.value = na.value, ...)

0 commit comments

Comments
 (0)