Skip to content

Commit cee085f

Browse files
committed
fix corner case where all annotation parameters have length 1
1 parent 3f6e315 commit cee085f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

R/annotation.r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ annotate <- function(geom, x = NULL, y = NULL, xmin = NULL, xmax = NULL,
4747
# Check that all aesthetic have compatible lengths
4848
lengths <- vapply(aesthetics, length, integer(1))
4949
n <- unique(setdiff(lengths, 1L))
50+
if (length(n) == 0L) n <- 1L # if all lengths are equal to 1L then above line fails, this fixes that
5051
unequal <- length(n) > 1L
5152
if (unequal) {
5253
bad <- lengths != 1L

0 commit comments

Comments
 (0)