Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x <- mapply(function(x, y) list(x * y, x + y), lapply(2:5, rnorm), lapply(2:5, rnorm))
- print(x)
- # [,1] [,2] [,3] [,4]
- # [1,] Numeric,2 Numeric,3 Numeric,4 Numeric,5
- # [2,] Numeric,2 Numeric,3 Numeric,4 Numeric,5
- str(x)
- # List of 8
- # $ : num [1:2] -0.209 -0.118
- # $ : num [1:2] -0.693 0.819
- # $ : num [1:3] 0.936 0.852 -0.887
- # $ : num [1:3] -2.789 2.617 -0.488
- # $ : num [1:4] -0.048 -0.0276 -0.4251 -0.8267
- # $ : num [1:4] -0.169 -0.403 1.223 0.291
- # $ : num [1:5] 0.0636 0.7842 1.08 -0.3552 -0.3187
- # $ : num [1:5] -1.09 -1.798 -2.132 -1.26 0.578
- # - attr(*, "dim")= int [1:2] 2 4
Advertisement
Add Comment
Please, Sign In to add comment