Skip to content

Commit

Permalink
Add flatten() and squash() purrr alternatives
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Feb 9, 2024
1 parent 76c2fa8 commit c65a32b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions R/compat-purrr.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,13 @@ compose <- function (...) {
out
}
}

flatten <- function(x) {
unlist(x, recursive = FALSE)
}

squash <- function(x) {
unlist(x, recursive = TRUE)
}

# nocov end

0 comments on commit c65a32b

Please sign in to comment.