Skip to content

Commit 3b9867c

Browse files
committed
exploit hexbin::hexcoords(n) arg
1 parent 82bf7d9 commit 3b9867c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

R/geom-hex.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ GeomHex <- ggproto("GeomHex", Geom,
2525
dy <- resolution(data$y, FALSE, TRUE) / sqrt(3) / 2 * 1.15
2626
}
2727

28-
hexC <- hexbin::hexcoords(dx, dy, n = 1)
29-
3028
n <- nrow(data)
29+
hexC <- hexbin::hexcoords(dx, dy, n = n)
3130

3231
hexdata <- data[rep(seq_len(n), each = 6), c("x", "y")]
3332
hexdata$x <- rep.int(hexC$x, n) + hexdata$x

0 commit comments

Comments
 (0)