title: Function returning multiple values in R
body: <p>Say I have a function</p>
  
  <pre><code>f &lt;- function(){
  
    # do things
  
    return(list(zoo = x, vector = y, integer = z))
  }
  </code></pre>
  
  <p>When I call this function using</p>
  
  <pre><code>result &lt;- f()
  </code></pre>
  
  <p>Is there any way to call the return variables explicitly? Ie do I have to call it using</p>
  
  <pre><code>vara &lt;- result$vara
  varb &lt;- result$varb
  varc &lt;- result$varc
  </code></pre>
  
  <p>Since if this function returns a lot of data types (whether it be data frames, zoo's, vectors, etc). The reason I dont want to bind into data frame is because not all variables are of the same length.</p>