In order to create a function to deal with moving averages, I bumped into this problem. Using dplyr and purrr, I tried to generate a list of closures.
v <- 5
funs <- map(1:v, ~ . %>% lag(n = .x) )
It occurs that, although funs[[1]](rnorm(100)) or funs[[2]](rnorm(100)) work, I didn't manage to make this line work:
invoke_map(funs, rnorm(100))
Why does this happen?