Guest User

Untitled

a guest
Jul 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. df <- data.frame(c(1:10))
  2.  
  3. pairwise <- function(i, j) { df[i,] + df[j,] }
  4.  
  5. m <- outer(1:nrow(df), 1:nrow(df), FUN = Vectorize(function(i,j) pairwise(i, j)))
Add Comment
Please, Sign In to add comment