Skip to content

Commit

Permalink
Use pluck_depth() in modify_depth()/map_depth()
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Aug 29, 2022
1 parent 49da5a6 commit ccf8f8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/map.R
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ map_depth <- function(.x, .depth, .f, ..., .ragged = FALSE) {
abort("`.depth` must be a single number")
}
if (.depth < 0) {
.depth <- vec_depth(.x) + .depth
.depth <- pluck_depth(.x) + .depth
}

.f <- as_mapper(.f, ...)
Expand Down
2 changes: 1 addition & 1 deletion R/modify.R
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ modify_depth.default <- function(.x, .depth, .f, ..., .ragged = .depth < 0) {
force(.ragged)

if (.depth < 0) {
.depth <- vec_depth(.x) + .depth
.depth <- pluck_depth(.x) + .depth
}

.f <- as_mapper(.f, ...)
Expand Down

0 comments on commit ccf8f8f

Please sign in to comment.