I have a quite large data frame, about 10 millions of rows. It has columns x and y, and what I want is to compute
x
y
hypot <- funct
R is vectorised, so you could use the following, plugging in your own matrix of course
X = t(matrix(1:4, 2, 2))^2 > [,1] [,2] [1,] 1 4 [2,] 9 16 rowSums(X)^0.5
Nice and efficient :)