title: Writing r function for multivariate function, I have 50 n's and 10 p's
body: <pre><code>REV &lt;- function(n,p){1-p/1+p + 2*p/n+n*p}^-1
  p_ &lt;- c(0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)
  n_ &lt;- seq(1,50)
  REV(n_, p_)
  </code></pre>
  <p>output is a length 50 vector
  I want a table of 50x10</p>
  <p>How can I make this run so it tries all values of p at all 50 values of n</p>