title: Simple question regarding the use of outer() and user-defined functions?
body: <pre><code>&gt; fun1 &lt;- function(x,y){x+y}
  &gt; outer(seq(1,5,length=5),seq(6,10,length=5),fun1)
       [,1] [,2] [,3] [,4] [,5]
  [1,]    7    8    9   10   11
  [2,]    8    9   10   11   12
  [3,]    9   10   11   12   13
  [4,]   10   11   12   13   14
  [5,]   11   12   13   14   15
  &gt; fun2 &lt;- function(x,y){z&lt;-c(x,y);z[1]+z[2]}
  &gt; outer(seq(1,5,length=5),seq(6,10,length=5),fun2)
  Error in dim(robj) &lt;- c(dX, dY) : 
    dims [product 25] do not match the length of object [1]
  </code></pre>
  
  <p>Why doesn't fun2() work? Aren't fun2() and fun1() essentially the same thing?</p>