title: Retrieve/access dynamic variable from R function
body: <p>I have a function in R that structures my raw data. I create a dataframe called <code>output</code> and then want to make a dynamic variable name depending on the function value <code>block</code>.</p>
  
  <p>The output object does contain a dataframe as I want, and to rename it dynamically, at the end of the function I do this (within the function):</p>
  
  <pre><code>a = assign(paste("output", block, sep=""), output)
  </code></pre>
  
  <p>... but after running the function there is no object output1 (if <code>block</code> = 1). I simply cannot retrieve the output object, neither merely <code>output</code> nor the dynamic <code>output1</code> version.</p>
  
  <p>I tried this then:</p>
  
  <p>a = assign(paste("output", block, sep=""), output)
     return(a)</p>
  
  <p>... but still - no success.
  How can I retrieve the dynamic output variable? Where is my mistake?</p>