I am wondering if it is possible to use the table captions like figure captions using knitr in .Rmd file ?
I saw options for figure caption but I couldn't see the option for the table caption. I also want to remove the message such as "% latex table generated in R 2.15.2 by xtable 1.7-0 package % Wed Mar 06 15:02:11 2013"
.
I used X table to create the table: The sample code I used is as follows:
```{r table2, results='asis', message=FALSE}
library(xtable)
print(xtable(head(iris)))
```
The table I got after processing through pandoc is as follows:
I tried to use message=FALSE in Rmd file to get rid of the message shown above. I also want to know if it is possible to automatically add the caption for table in Rmd ?
By caption I mean something like below (this is for the figure) and the figure number is automatically updated.
This output is a snapshot from the pdf generated by pdf using the markdown file created by knitr.
Thank you.
?xtable
and?print.xtable
. Look attype
andcaption
– Cartloadxtable
; see github.com/yihui/knitr-book/issues/3 (the new version ofxtable
is on CRAN now) – Luna{r table2, results='asis', message=FALSE,echo=FALSE} library(xtable) print(xtable(head(iris)))
</pre>. Did I do anything wrong ? – Lumberjack?print.xtable
and see thecomment
argument – Luna