title: how to force column to rownames in multiple split dataframes then apply a function over all dataframes (of unequal lengths)?
body: <p>I am trying to force column to rownames in multiple split dataframes then apply a function over all dataframes? (unequal lengths) I get the error that is embedded in the code below. Can I work past this?</p>
  
  <pre><code># sample dataset below
  
  ID &lt;- c("SB1","SB2","SB3","SB4","SB1","SB1","SB2","SB4","SB2", "SB1")
  z &lt;- c("A","B","C","D","E","A","B","C","D","D")
  x &lt;- 1:2
  y &lt;- 1:10
  n &lt;- max(length(x), length(y))
  year &lt;- c(1999,1999,1999,1999,2000,2001,2000,2001,2001,2002)
  length(x) &lt;- n                      
  length(y) &lt;- n
  length(z) &lt;- n
  length(year) &lt;- n
  sitebyspec &lt;- cbind(ID,x,y,z,year)
  sitebyspec &lt;- as.data.frame(sitebyspec)
  
  
  # my process (split df by year, force ID column to rownames)
  sitebyspec.split &lt;- split(sitebyspec, (sitebyspec$year)) # split based on season
  as.data.frame(sitebyspec.split) %&gt;% remove_rownames %&gt;% column_to_rownames(var="ID")
      ## Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : arguments imply differing number of rows: 4, 2, 3, 1
  
  # my next step if this worked ... 
  sitebyspec.split %&gt;%
    sitebyspec.split[,c(1:3)] %&gt;%
    map(~ contribdiv(., "richness")) %&gt;%
    map(summary)
  </code></pre>
  
  <p>Can I integrate the column to rownames into this last step?</p>