title: How to add caption with the tables r package?
body: <p>Using the iris data, we make a table with the <code>tables</code> package:</p>
  
  <pre><code>library(tables)
  table &lt;- tabular( (Sepal.Length+Sepal.Width) ~
             Format(format(digits=2))*(mean + sd), data=iris )
  </code></pre>
  
  <p>With the <code>Hmisc</code> package, we would add the caption with the <code>latex</code> function like this:</p>
  
  <pre><code>latex(table, caption="My table")
  </code></pre>
  
  <p>But that does not work with the <code>tables</code> package, because it defines an S3 method, <code>latex.tabular</code>.</p>
  
  <p>So I have tried this, following an example in the <a href="http://cran.r-project.org/web/packages/tables/tables.pdf" rel="nofollow">package vignette</a>:</p>
  
  <pre><code>latex(table, options=list(toprule="\\caption{My table}"))
  </code></pre>
  
  <p>But it does not work, it says that caption is outside float. How can I correctly add caption with the <code>latex.tabular</code> function from the <code>tables</code> package?</p>