I'm trying to incorporate more pipes in my code. Oftentimes, I have to break up pipes to use the apply function. Then I found purrr. However, it's not clear to me how exactly it works. Here is what I want, and what I've tried. The main problem is that I want a rowwise computation.
want:
apply(mtcars,1,function(x) which.max(x))
have:
mtcars %>% map_dbl(which.max)