celestialgod

Untitled

Feb 18th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.62 KB | None | 0 0
  1. x <- mapply(function(x, y) list(x * y, x + y), lapply(2:5, rnorm), lapply(2:5, rnorm))
  2. print(x)
  3. #      [,1]      [,2]      [,3]      [,4]    
  4. # [1,] Numeric,2 Numeric,3 Numeric,4 Numeric,5
  5. # [2,] Numeric,2 Numeric,3 Numeric,4 Numeric,5
  6. str(x)
  7. # List of 8
  8. #  $ : num [1:2] -0.209 -0.118
  9. #  $ : num [1:2] -0.693 0.819
  10. #  $ : num [1:3] 0.936 0.852 -0.887
  11. #  $ : num [1:3] -2.789 2.617 -0.488
  12. #  $ : num [1:4] -0.048 -0.0276 -0.4251 -0.8267
  13. #  $ : num [1:4] -0.169 -0.403 1.223 0.291
  14. #  $ : num [1:5] 0.0636 0.7842 1.08 -0.3552 -0.3187
  15. #  $ : num [1:5] -1.09 -1.798 -2.132 -1.26 0.578
  16. #  - attr(*, "dim")= int [1:2] 2 4
Advertisement
Add Comment
Please, Sign In to add comment