Skip to content

Commit b468c9d

Browse files
committed
fix missing %||% on old R versions
1 parent 97b91a7 commit b468c9d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

R/position-.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@
4444
#' # Methods
4545
#' setup_params = function(self, data) list(width = self$width),
4646
#' compute_panel = function(data, params, scales) {
47-
#' width <- params$width %||% (resolution(data$x, zero = FALSE, TRUE) * 0.4)
48-
#' rank <- ave(data$y, data$group, FUN = rank)
47+
#' width <- params$width
48+
#' if (is.null(width)) {
49+
#' width <- resolution(data$x, zero = FALSE, TRUE) * 0.4
50+
#' }
51+
#' rank <- stats::ave(data$y, data$group, FUN = rank)
4952
#' rank <- scales::rescale(rank, to = c(-width, width) / 2)
5053
#' data$x <- data$x + rank
5154
#' data

man/Position.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)