Skip to content

Commit 7c6d056

Browse files
committed
Coerce to factor as suggested by @teunbrand
1 parent 6e4077e commit 7c6d056

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/geom-.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Geom <- ggproto("Geom",
7878
# Trim off extra parameters
7979
params <- params[intersect(names(params), self$parameters())]
8080

81-
if (length(levels(data$PANEL)) > 1L) {
81+
if (nlevels(as.factor(data$PANEL)) > 1L) {
8282
data_panels <- split(data, data$PANEL)
8383
} else {
8484
data_panels <- list(data)

0 commit comments

Comments
 (0)