If I try to run something like table %>% map(. %>% pull(column), function)
, the inside pipe is apparently stripped out, so that map()
's first argument is the table itself, and an attempt is made to make pull(column)
the second argument. Why is this?
Since it was hard to tell what was going on with map()
, I used debug(map2)
so I could inspect the .x
and .y
arguments passed to map2()
in the following code:
library(tidyverse)
tibble(a = 1:3) %>%
map2(. %>% pull(a), . %>% pull(a), ~ 'yes')
#> Error: `.y` must be a vector, not a `fseq/function` object
Created on 2020-03-04 by the reprex package (v0.3.0)
(It would have nice to be able to reprex walking through the code with debug()
, but I couldn't figure that out either! A question for another post. )