11

I am using the xtable to produce tex output of a dataframe in R.3.3. Is there a way to write the output to a file? When I use it I am only able to obtain tex code in my R console.

splinter
  • 3,727
  • 8
  • 37
  • 82

1 Answers1

19

The print() command for xtable objects takes a file= parameter to write to a file

library(xtable)
data(tli)
tli.table <- xtable(tli[1:20, ])
print(tli.table, file="table.txt")

see ?print.xtable for all the options.

MrFlick
  • 195,160
  • 17
  • 277
  • 295