fork download
  1. minhafuncao <- function(a, b, c) {
  2. return(a * b + c)
  3. }
  4.  
  5. x <- array(1:15, dim=c(5,3))
  6. x
  7.  
  8. apply(x, 1, function(arr) do.call("minhafuncao", lapply(arr, identity)))
  9.  
Success #stdin #stdout 0.3s 22840KB
stdin
Standard input is empty
stdout
     [,1] [,2] [,3]
[1,]    1    6   11
[2,]    2    7   12
[3,]    3    8   13
[4,]    4    9   14
[5,]    5   10   15
[1] 17 26 37 50 65