title: Getting a dataframe from a nested list using dlply/ldply R
body: <p>I am using dlply to apply a function to a data.frame and generate a list for each combination of factors:</p>
  
  <p>first I generate some data</p>
  
  <pre><code>is1 &lt;- data.frame()
  for( s in c("Big","Med", "Sma")) {
   for(i in 1:3){
  
   c &lt;- rnorm(1,0,10)
   n &lt;- rnorm(1,-1,10)
   is1 &lt;- rbind(is1,data.frame(Site=i,SizeClass=s,d13C=rnorm(10,c,2),d15N=rnorm(10,n,2)))
   }
  }
  </code></pre>
  
  <p>them apply the function from siar package</p>
  
  <pre><code>require(plyr)
  require(siar)
  ell &lt;-dlply(is1,.(Site,SizeClass),function(x) standard.ellipse(x$d13C,x$d15N,steps=1))
  </code></pre>
  
  <p>I want a data.frame with some fields so I try to use ldply with a function</p>
  
  <pre><code>extract_SEAc &lt;- function(e)
  {
    c(sapply(e, '[[', 'xSEAc'),sapply(e, '[[', 'ySEAc'))
  }
  ell &lt;- ldply(ell, .(Site,SizeClass), extract_SEAc )
  </code></pre>
  
  <p>but it gives an error</p>
  
  <pre><code>error: trying to apply a no-function
  </code></pre>
  
  <p>any ideas?</p>