43

By using xtable and knitr, I add a table to my RMD document and export to PDF file.

```{r, results='asis'}
library(xtable)
xtable(matrixtable)
````

It looks great except there is a line

% latex table generated in R 3.1.0 by xtable 1.7-3 package % Wed Jun 25 13:34:57 2014

How can I remove this line. I tried to set message=FALSE but it doesn't work.

gagolews
  • 12,836
  • 2
  • 50
  • 75
tky
  • 687
  • 1
  • 5
  • 9

2 Answers2

77

The inclusion of the comment in the final table is defined by the comment argument to print.xtable

the default value for this is getOption('xtable.comment',TRUE).

so, if you set

options(xtable.comment = FALSE)

then for any future tables this comment will not produced.

mnel
  • 113,303
  • 27
  • 265
  • 254
29

You can put in directly in the print statement like so:

xtb=xtable(...)
print(xtb, comment=FALSE)
Daniel
  • 3,243
  • 2
  • 32
  • 31