title: Convert all columns in list of data frames to time series
body: <p>I have such a list:</p>
  
  <pre><code>df1 &lt;- data.frame(var1 = 1:5, var2 = 6:10)
  rownames(df1) &lt;- 2001:2005
  df2 &lt;- data.frame(var5 = 21:25, var6 = 26:30)
  rownames(df2) &lt;- 2006:2010
  mylist &lt;- list(df1,df2)
  
  &gt; mylist
  [[1]]
       var1 var2
  2001    1    6
  2002    2    7
  2003    3    8
  2004    4    9
  2005    5   10
  
  [[2]]
       var5 var6
  2006   21   26
  2007   22   27
  2008   23   28
  2009   24   29
  2010   25   30
  </code></pre>
  
  <p>How can I convert each column within each data frame to a time series where start and end are given by min and max of the rownames of the respective data frame?</p>
  
  <p>I tried:</p>
  
  <pre><code>lapply(mylist, function(x) {apply(x, 2, function(y) ts(y, start = min(rownames(y), end = max(rownames(y)))))})
  </code></pre>
  
  <p>resulting in: </p>
  
  <pre><code> Error in if (nobs != ndata) data &lt;- if (NCOL(data) == 1) { : 
    missing value where TRUE/FALSE needed 
  </code></pre>
  
  <p>but fail to make any sense of that.</p>