Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. library(purrr)
  2.  
  3. map2(1:3, 1:3, fn)
  4.  
  5. [[1]]
  6. res text
  7. 1 1 a
  8. 2 1 b
  9. 3 2 total
  10.  
  11. [[2]]
  12. res text
  13. 1 2 a
  14. 2 2 b
  15. 3 4 total
  16.  
  17. [[3]]
  18. res text
  19. 1 3 a
  20. 2 3 b
  21. 3 6 total
  22.  
  23. x <- mapply(fn, b = 1:3, a = 1:3, SIMPLIFY = F)
  24.  
  25. x <- Map(fn, b = 1:3, a = 1:3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement