Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions R/position-dodge.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ PositionDodge <- ggproto("PositionDodge", Position,
if (identical(self$preserve, "total")) {
n <- NULL
} else {
n <- vec_unique(data[c("group", "PANEL", "xmin")])
n <- vec_group_id(n[c("PANEL", "xmin")])
data$xmin <- data$xmin %||% data$x
cols <- intersect(colnames(data), c("group", "PANEL", "xmin"))
n <- vec_unique(data[cols])
n <- vec_group_id(n[setdiff(cols, "group")])
n <- max(tabulate(n, attr(n, "n")))
}

Expand Down