Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing to file with xtable in R

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.

like image 921
splinter Avatar asked Apr 06 '17 19:04

splinter


1 Answers

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.

like image 179
MrFlick Avatar answered Oct 03 '22 21:10

MrFlick