Skip to content

Commit b242644

Browse files
committed
add group_row parameter
1 parent 6a447ba commit b242644

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

R/position-dodge2.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
#' @param padding Padding between elements at the same position. Elements are
44
#' shrunk by this proportion to allow space between them. Defaults to 0.1.
55
position_dodge2 <- function(width = NULL, preserve = "total",
6-
padding = 0.1, reverse = FALSE) {
6+
padding = 0.1, reverse = FALSE,
7+
group_row = "single") {
78
ggproto(NULL, PositionDodge2,
89
width = width,
910
preserve = arg_match0(preserve, c("total", "single")),
1011
padding = padding,
11-
reverse = reverse
12+
reverse = reverse,
13+
group_row = group_row
1214
)
1315
}
1416

@@ -20,6 +22,7 @@ PositionDodge2 <- ggproto("PositionDodge2", PositionDodge,
2022
preserve = "total",
2123
padding = 0.1,
2224
reverse = FALSE,
25+
group_row = "single",
2326

2427
setup_params = function(self, data) {
2528
flipped_aes <- has_flipped_aes(data)
@@ -48,7 +51,8 @@ PositionDodge2 <- ggproto("PositionDodge2", PositionDodge,
4851
n = n,
4952
padding = self$padding,
5053
reverse = self$reverse,
51-
flipped_aes = flipped_aes
54+
flipped_aes = flipped_aes,
55+
group_row = self$group_row
5256
)
5357
},
5458

0 commit comments

Comments
 (0)