purrr
purrr copied to clipboard
A functional programming toolkit for R
How is it that the first of these works but not the rest? ``` library (dplyr) # ...snip... library (purrr) BOD %>% mutate(sum = exec(pmin, !!!.)) # works ## Time...
Hi all, I was checking some things on R, and someone tell me, "did you notice map_dfr is superseded?" then checking the docs in fact, it is, is not only...
Hi! I have included the option .progress=TRUE within the map function and I can see the bar when I lrun the script from Rstudio but not when I launch it...
Hi, When you use `map_xxx()`, for instance `map_chr()`, the function `.f` should return a value of length exactly 1. While I agree that a value of length >1 is obviously...
With the transition from `transpose()` to `list_transpose()` comes this (new) incompatibility: ```r > purrr::list_transpose(mtcars) # Error in `purrr::list_transpose()`: # ! `x` must be a list, not a object. # Run...
Dear developers. I was doing exercise of [Advanced R 9.2.7](https://advanced-r-solutions.rbind.io/functionals). Question2. _[map(1:3, ~ runif(2))](https://purrr.tidyverse.org/reference/map.html) is a useful pattern for generating random numbers, but [map(1:3, runif(2))](https://purrr.tidyverse.org/reference/map.html) is not. Why not? Can...
The documentation of the `...` attribute refers to the `map()` function. It would be a bit nicer if the reference for `reduce` would point to `reduce()` instead of `map()` ;)
Applying `lmap` to a _tibble_ now returns a simple data.frame. I'm pretty sure the class `c("tbl_df", "tbl", "data.frame")` was preserved (before version 1.0?). ```r iris %>% tibble::as_tibble() %>% lmap(identity) %>%...
map_dfr
`map_dfr` has been deprecated and the help file suggests using `map` with `list_rbind` or `list_cbind` but that means that we need two commands where we used to get away with...