purrr
purrr copied to clipboard
A functional programming toolkit for R
https://github.com/tidyverse/purrr/blob/6ead03537e9c4395b55721421f87e41a3a5ec76b/R/rate.R#L317 I am using rate backoff for query retry logic and frequently get log messages like: > Retrying in 6e+01 seconds. My coworkers would like to see something like: >...
I'd like to be able to add an ID column to the output of `map_dfr` that's not defined by the names of the result, but rather is specified in the...
I frequently want to create a named atomic vector by extracting from a homogeneous list: - values = elements extracted via name "foo" - names = elements extracted via name...
I have encountered a strange bug that I believe originates with some kind of scoping issue between data.table and purrr. When I try to purrr::map a vector of paths of...
I accidentally used `chuck()` instead of `pluck()` and was quite confused by the error as I provided a default. It was something along the lines of ``` r purrr::chuck(list(a =...
I think the error messages in `chuck` are sometimes a bit confusing and could be more understandable and detailed: ``` r purrr::chuck(list(a = list(b = 1)), "a", "c") #> Error:...
The generic and default method have `.else` https://github.com/tidyverse/purrr/blob/5de5ad293b817d8a6baea32cc4415487d71da955/R/modify.R#L215-L237
The functional programming language F# has a fantastic function that I believe should be considered for adding to purrr. It's basically the reverse of reduce/accumulate. It's the "[unfold](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/seq.unfold%5B%27state,%27t%5D-function-%5Bfsharp%5D?f=255&MSPPError=-2147217396)" function and...
`ave()` is the base functional I use the most if I attach *tidyverse*, but it has several issues : * Its name, and default, are awkward, I was a bit...
``` r library(purrr) every( c(FALSE, NA), identity ) #> [1] FALSE every( c(NA, FALSE), identity ) #> [1] NA ``` IMHO it should return the same and be consistent with...