title: Creating a dataframe by using row numbers of other data frames in R
body: <p>I would like to know that whether there is a way in R for using datasets with similar names. For example:</p>
  
  <p>I have eight datasets named <code>cars_1995</code>, <code>cars_new_1995</code>, <code>cars_1996</code>, <code>cars_new_1996</code>, <code>cars_1997</code>, <code>cars_new_1997</code>, <code>cars_1998</code> and <code>cars_new_1998</code> and they have different dimensions but only thing that I want to use is their row numbers.</p>
  
  <p>So I want to create a new data frame and rownames will be the years (1995,1996,1997,1998) and colnames will be the groups (<code>cars</code>, <code>cars_new</code>). the dimension of the data frame will be 4:2. The values of the dataframe will be the rownumbers such as:</p>
  
  <pre><code>       Cars  Cars_new
    1995  25  76 
    1996  38  35 
    1997  87  49 
    1998  34  50
  </code></pre>
  
  <p>First question is, in the R, is there a way to use the names of dataframes like I need to take row numbers of all data frames from 1995 to 1999 (one column for <code>cars_YEAR</code>, the other column for <code>cars_YEAR_new</code>). By the way only year indicator is the names of the data frames. </p>
  
  <p>I'm OK with how to build a data frame or how to get the rownumbers (<code>nrow</code>) However, I haven't figured out how to pull all datasets by just using embed years of the dataframes' names consecutively.So it would be great how to get all <code>cars_YEAR</code> datasets row numbers by using the year extension in the datasets names.</p>