Writing to file with xtable in R
Asked Answered
H

1

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.

Hoitytoity answered 6/4, 2017 at 19:18 Comment(0)
O
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.

Owing answered 6/4, 2017 at 19:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.