Skip to content

Commit 43dcd63

Browse files
authored
Remove warning when guide functions are used in identity scales (#3131)
* properly check for presence/absence of guide. Closes #3127. * use `identical()` instead of `isTRUE()`.
1 parent 9a87145 commit 43dcd63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/scale-identity.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ ScaleDiscreteIdentity <- ggproto("ScaleDiscreteIdentity", ScaleDiscrete,
146146

147147
train = function(self, x) {
148148
# do nothing if no guide, otherwise train so we know what breaks to use
149-
if (self$guide == "none") return()
149+
if (identical(self$guide, "none")) return()
150150
ggproto_parent(ScaleDiscrete, self)$train(x)
151151
}
152152
)
@@ -167,7 +167,7 @@ ScaleContinuousIdentity <- ggproto("ScaleContinuousIdentity", ScaleContinuous,
167167

168168
train = function(self, x) {
169169
# do nothing if no guide, otherwise train so we know what breaks to use
170-
if (self$guide == "none") return()
170+
if (identical(self$guide, "none")) return()
171171
ggproto_parent(ScaleContinuous, self)$train(x)
172172
}
173173
)

0 commit comments

Comments
 (0)