Skip to content

Commit

Permalink
Merge pull request #1215 from r-lib/use-stable-purrr
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil authored May 23, 2024
2 parents 3394099 + 9e9d8ec commit ad1cac1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Depends:
Imports:
cli (>= 3.1.1),
magrittr (>= 2.0.0),
purrr (>= 0.2.3),
purrr (>= 1.0.2),
R.cache (>= 0.15.0),
rlang (>= 1.0.0),
rprojroot (>= 1.1),
Expand Down
12 changes: 0 additions & 12 deletions R/compat-dplyr.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ lead <- function(x, n = 1L, default = NA) {
c(x[-seq_len(n)], rep(default, n))
}


arrange <- function(.data, ...) {
ord <- eval(substitute(order(...)), .data, parent.frame())
vec_slice(.data, ord)
}

arrange_pos_id <- function(data) {
pos_id <- data$pos_id
if (is.unsorted(pos_id)) {
Expand Down Expand Up @@ -51,9 +45,3 @@ left_join <- function(x, y, by) {
last <- function(x) {
x[[length(x)]]
}

map_dfr <- function(.x, .f, ...) {
.f <- purrr::as_mapper(.f, ...)
res <- map(.x, .f, ...)
vec_rbind(!!!res)
}
5 changes: 3 additions & 2 deletions R/visit.R
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,11 @@ enrich_terminals <- function(flattened_pd, use_raw_indention = FALSE) {
groups <- flattened_pd$line1
split_pd <- vec_split(flattened_pd, groups)[[2L]]
flattened_pd <- split_pd %>%
map_dfr(function(.x) {
purrr::map(function(.x) {
.x$col2 <- cumsum(.x$nchar + .x$lag_spaces)
.x
})
}) %>%
purrr::list_rbind()
flattened_pd$col1 <- flattened_pd$col2 - flattened_pd$nchar
flattened_pd
}
Expand Down

0 comments on commit ad1cac1

Please sign in to comment.