@@ -90,7 +90,9 @@ scale_colour_continuous <- function(..., palette = NULL, aesthetics = "colour",
90
90
guide = " colourbar" , na.value = " grey50" ,
91
91
type = getOption(" ggplot2.continuous.colour" )) {
92
92
93
- if (! is.null(type ) && is.null(palette )) {
93
+ has_old_args <- any(names(enexprs(... )) %in% c(" low" , " high" ))
94
+
95
+ if (has_old_args || ! is.null(type ) && is.null(palette )) {
94
96
scale <- scale_backward_compatibility(
95
97
... , guide = guide , na.value = na.value , scale = type ,
96
98
aesthetic = " colour" , type = " continuous"
@@ -110,7 +112,9 @@ scale_fill_continuous <- function(..., palette = NULL, aesthetics = "fill", guid
110
112
na.value = " grey50" ,
111
113
type = getOption(" ggplot2.continuous.fill" )) {
112
114
113
- if (! is.null(type ) && is.null(palette )) {
115
+ has_old_args <- any(names(enexprs(... )) %in% c(" low" , " high" ))
116
+
117
+ if (has_old_args || ! is.null(type ) && is.null(palette )) {
114
118
scale <- scale_backward_compatibility(
115
119
... , guide = guide , na.value = na.value , scale = type ,
116
120
aesthetic = " fill" , type = " continuous"
@@ -129,7 +133,10 @@ scale_fill_continuous <- function(..., palette = NULL, aesthetics = "fill", guid
129
133
scale_colour_binned <- function (... , palette = NULL , aesthetics = " colour" , guide = " coloursteps" ,
130
134
na.value = " grey50" ,
131
135
type = getOption(" ggplot2.binned.colour" )) {
132
- if (! is.null(type ) && is.null(palette )) {
136
+
137
+ has_old_args <- any(names(enexprs(... )) %in% c(" low" , " high" ))
138
+
139
+ if (has_old_args || ! is.null(type ) && is.null(palette )) {
133
140
scale <- scale_backward_compatibility(
134
141
... , guide = guide , na.value = na.value , scale = type ,
135
142
aesthetic = " colour" , type = " binned"
@@ -148,7 +155,9 @@ scale_colour_binned <- function(..., palette = NULL, aesthetics = "colour", guid
148
155
scale_fill_binned <- function (... , palette = NULL , aesthetics = " fill" , guide = " coloursteps" ,
149
156
na.value = " grey50" ,
150
157
type = getOption(" ggplot2.binned.fill" )) {
151
- if (! is.null(type ) && is.null(palette )) {
158
+ has_old_args <- any(names(enexprs(... )) %in% c(" low" , " high" ))
159
+
160
+ if (has_old_args || ! is.null(type ) && is.null(palette )) {
152
161
scale <- scale_backward_compatibility(
153
162
... , guide = guide , na.value = na.value , scale = type ,
154
163
aesthetic = " fill" , type = " binned"
@@ -212,7 +221,10 @@ scale_fill_binned <- function(..., palette = NULL, aesthetics = "fill", guide =
212
221
# ' theme_set(old)
213
222
scale_colour_discrete <- function (... , palette = NULL , aesthetics = " colour" , na.value = " grey50" ,
214
223
type = getOption(" ggplot2.discrete.colour" )) {
215
- if (! is.null(type ) && is.null(palette )) {
224
+
225
+ has_old_args <- any(names(enexprs(... )) %in% c(" h" , " c" , " l" , " h.start" , " direction" ))
226
+
227
+ if (has_old_args || ! is.null(type ) && is.null(palette )) {
216
228
scale <- scale_backward_compatibility(
217
229
... , na.value = na.value , scale = type ,
218
230
aesthetic = " colour" , type = " discrete"
@@ -230,7 +242,10 @@ scale_colour_discrete <- function(..., palette = NULL, aesthetics = "colour", na
230
242
# ' @export
231
243
scale_fill_discrete <- function (... , palette = NULL , aesthetics = " fill" , na.value = " grey50" ,
232
244
type = getOption(" ggplot2.discrete.fill" )) {
233
- if (! is.null(type ) && is.null(palette )) {
245
+
246
+ has_old_args <- any(names(enexprs(... )) %in% c(" h" , " c" , " l" , " h.start" , " direction" ))
247
+
248
+ if (has_old_args || ! is.null(type ) && is.null(palette )) {
234
249
scale <- scale_backward_compatibility(
235
250
... , na.value = na.value , scale = type ,
236
251
aesthetic = " fill" , type = " discrete"
0 commit comments