Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(purrr)
- map2(1:3, 1:3, fn)
- [[1]]
- res text
- 1 1 a
- 2 1 b
- 3 2 total
- [[2]]
- res text
- 1 2 a
- 2 2 b
- 3 4 total
- [[3]]
- res text
- 1 3 a
- 2 3 b
- 3 6 total
- x <- mapply(fn, b = 1:3, a = 1:3, SIMPLIFY = F)
- x <- Map(fn, b = 1:3, a = 1:3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement