title: argument "nm" is missing error while gathering data frames into a list by name
body: <p>I tried using the advice given in <a href="https://stackoverflow.com/questions/14954399/put-multiple-data-frames-into-list-smart-way">Put multiple data frames into list (smart way)</a> but continue getting the following error:</p>
  <pre><code>argument &quot;nm&quot; is missing, with no default
  </code></pre>
  <p>I'm not sure why this is the case. I tried searching the error but couldn't find anything on it (<a href="https://stackoverflow.com/questions/29501176/create-a-list-with-named-values-by-applying-a-function-to-each-row-of-a-data-fra">Create a list with named values by applying a function to each row of a data frame</a> shows this error in a comment but didn't explain it).</p>
  <p>I have the following data.frames (data doesn't matter only name here):</p>
  <pre><code>#create data.frames
  p1sfdf1=data.frame(a=(1:10),b=(2:11),c=(3:12))
  p2sfdf1=data.frame(a=(1:10),b=(2:11),c=(3:12))
  p1sfdf2=data.frame(a=(1:10),b=(2:11),c=(3:12))
  p2sfdf2=data.frame(a=(1:10),b=(2:11),c=(3:12))
  p1sfdf3=data.frame(a=(1:10),b=(2:11),c=(3:12))
  p2sfdf3=data.frame(a=(1:10),b=(2:11),c=(3:12))
  p1sfdf4=data.frame(a=(1:10),b=(2:11),c=(3:12))
  #note no p2sfdf4 here
  p1sfdf5=data.frame(a=(1:10),b=(2:11),c=(3:12))
  p2sfdf5=data.frame(a=(1:10),b=(2:11),c=(3:12))
  
  #combine data.frames into a list of data.frames
  l.sf=setNames(lapply(ls(pattern=&quot;p[1-2]+&quot;),function(x) get(x)))
                       
  
  </code></pre>
  <p>I would like to group the data.frames into a list of data.frames. I tried to group based off of the pattern &quot;p&quot; and then either 1 or 2 but I wasn't sure how to demonstrate that in the pattern. I'm guessing that's where my error comes from, but I'm not sure how to fix it.</p>