title: Assigning output of a function to two variables in R
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8216470/function-with-multiple-outputs">function with multiple outputs</a>  </p>
  </blockquote>
  
  
  
  <p>This seems like an easy question, but I can't figure it out and I haven't had luck in the R manuals I've looked at. I want to find <code>dim(x)</code>, but I want to assign <code>dim(x)[1]</code> to <code>a</code> and <code>dim(x)[2]</code> to <code>b</code> in a single line.</p>
  
  <p>I've tried <code>[a b] &lt;- dim(x)</code> and <code>c(a, b) &lt;- dim(x)</code>, but neither has worked. Is there a one-line way to do this? It seems like a very basic thing that should be easy to handle.</p>