title: R formula on a dataframe
body: <p>I want to add the formulas I have used in a series of models to a data.frame</p>
  
  <pre><code>require(plyr)
  require(nlme)
  str(baseball)
  ba &lt;- baseball[1:100,]
  m01 &lt;- gls( g ~ ab+I(r^2)+cos(pi*h),data=ba,correlation = corARMA(p=1))
  m02 &lt;- gls( g ~ I(ab^3)+r+cos(pi*h)+sin(pi*h),data=ba,correlation = corARMA(p=1))
  m03 &lt;- gls( g ~ ab+r,data=ba,correlation = corARMA(p=1))
  </code></pre>
  
  <p>I have 3 models then I want two columns: the name of the model and the formula </p>
  
  <pre><code>mof &lt;-ldply(ls(pattern=glob2rx("m0*")))
  
  mof &lt;-ddply(mof, .(V1),transform, form =formula(V1))
  </code></pre>
  
  <p>which gives</p>
  
  <pre><code>Error en as.data.frame.default(x[[i]], optional = TRUE) : 
    cannot coerce class '"formula"' into a data.frame
  </code></pre>
  
  <p>I have tried a lot of different things but can't make it work.</p>