R: Put Variables from .GlobalEnv, that meet certain criteria in list
<p>For some weeks I measured data once a week. Since the measuring instrument was used elsewhere in between I now got quite a few <code>.csv</code>-Files that I read into R and got them in my workspace now. I named them alike so that all of the <code>data.frames</code> contain the pattern &quot;11.&quot; in their variable name. I know I can get a list of (only) those variable names by using</p>
<pre><code>ls(pattern = &quot;11.&quot;)
</code></pre>
<p>But I want to have a <code>list</code> containing those <code>data.frames</code>. Of course I could go back in my script and change the <code>read.table</code> command from e.g.</p>
<pre><code>A.11.01 &lt;- read.table(...)
</code></pre>
<p>to</p>
<pre><code>data.list[1] &lt;- read.table(...)
</code></pre>
<p>and later change the name of the list element <code>data.list[1]</code> to &quot;A.11.01&quot; (and would have saved a nice amount of time if I had done this immediately) and I'm quite sure I could also find out how to do this defining and naming of a list element in only one command, but it feels as if there is quite a simple option to let R create this list at all.</p>
<p>(Another approach I tried was <code>data.list[1] &lt;- .GlobalEnv[1]</code>, but I ended up finding no way to subset an <code>environment</code>. (My other approaches seem too silly to be mentioned at all.))</p>