Skip to content

Commit

Permalink
fxi warning message for unit object: partial argument match of 'i' to…
Browse files Browse the repository at this point in the history
… 'index'
  • Loading branch information
Yunuuuu committed Jan 2, 2025
1 parent 0fd6dd0 commit b5a7859
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/ggplot-helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,13 @@ element_vec_rep_each <- function(.el, times, ...) {
}

#' @inheritParams vctrs::vec_slice
#' @importFrom grid is.unit
#' @export
#' @rdname element_vec
element_vec_slice <- function(.el, i, ...) {
element_vec(.el, vec_slice, i = i, ...)
element_vec(.el, function(x) {
if (is.unit(x)) x[i, ...] else vec_slice(x, i, ...)
})
}

element_vec_fields <- function(el) UseMethod("element_vec_fields")
Expand Down

0 comments on commit b5a7859

Please sign in to comment.