Vector of different n values in rbeta
<p>I would like to simultaneously use vectors of different parameter values in rbeta and get out a vector whose length is the sum of the elements of the n vector.  For example,</p>

<pre><code>n &lt;- c(10, 20, 30)
alpha &lt;- c(1,2,3)
beta &lt;- c(3,2,1)
rbeta(n, alpha, beta)
</code></pre>

<p>The bottom line doesn't do what I would like.  I want the output to be a vector of length 10+20+30 = 60, with the first 10 elements being 10 samples from a beta(1,3), the next 20 elements from a beta(2,2) and the next 30 elements from a beta(3,1).  What is the best way to do this?</p>