purrr
purrr copied to clipboard
A functional programming toolkit for R
This PR implements `map_vec()`, a vctrs powered `map()` that attempts to simplify the output automatically by computing the common type of the result elements. If a common type can be...
Fix #632 Currently, `modify2()` recycles the first argument when it is 1-length object, so the result is no more have the original class and attributes. This PR makes `recycle_args()` more...
This closes #405 by bringing back [old](2f76d3e4c3cace662f975b82b4afc98b0617ecfc) `flatmap()` as suggested `map_flat_type` function. This PR adds * `map_flat()` is equivalent to `map()` followed by `flatten()` * `map_flat_lgl()`, `map_flat_int()`, `map_flap_dbl()`, `map_flat_chr()` and...
Hi, It would be very convenient if the value returned in `$warning` and `$message` was the actual condition instead of only the text message when using `quietly()` (or, in an...
Hi, This is a revival of #337: > Use `.default = NA` > _Originally posted by @hadley in https://github.com/tidyverse/purrr/issues/337#issuecomment-311067457_ In fact, applying the closing comment does not solve the original...
Current implementation of `assign_in`, `update_in` and `pluck
I tried to use the `seq.int()` method instead of the `seq()` generics in map2(), but I receive strange errors. The code with the generics: ``` r library(reprex) library(purrr) x [1]...
When it comes to nested dataframes, pmap_dfr exercises some weird behaviour. I don't know if this is an issue or a desired effect, but worth noting. ```r tibble(a = 1,...
To improve rlang backtraces. See https://github.com/r-lib/rlang/issues/1023
I feel this is likely related to #822, but currently you cannot `zap` list elements. ``` r library(purrr) x named list() x $a #> $a[[1]] #> [1] 2 ```