Skip to content

Commit 6c13d47

Browse files
committed
ensure if switch is scalar
1 parent c4ffa57 commit 6c13d47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/guide-colorsteps.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ GuideColoursteps <- ggproto(
194194
params$title <- scale$make_title(params$title, scale$name, title)
195195

196196
limits <- c(params$decor$min[1], params$decor$max[nrow(params$decor)])
197-
if (params$reverse) {
197+
if (isTRUE(params$reverse)) {
198198
limits <- rev(limits)
199199
}
200200
params$key$.value <- rescale(params$key$.value, from = limits)

R/position-dodge.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ PositionDodge <- ggproto("PositionDodge", Position,
152152
data$order <- xtfrm( # xtfrm makes anything 'sortable'
153153
data$order %||% ave(data$group, data$x, data$PANEL, FUN = match_sorted)
154154
)
155-
if (params$reverse) {
155+
if (isTRUE(params$reverse)) {
156156
data$order <- -data$order
157157
}
158158
if (is.null(params$n)) { # preserve = "total"

0 commit comments

Comments
 (0)