Hello all I am new to R and Latex and have been stuck on creating a PDF with the xtable function.
The code runs fine and the table is generated in the console however I can not figure out how to save just the table as a pdf. Do I need to link R and Latex with a folder on my computer to save the file?
library(xtable)
options(xtable.floating = FALSE)
options(xtable.timestamp = "")
data(tli)
table<- xtable(tli[1:10, ])
print(table)
And I get this output
> library(xtable).
> options(xtable.floating = FALSE)
> options(xtable.timestamp = "")
>
> data(tli).
> table<- xtable(tli[1:10, ])
>
> print(table)
% latex table generated in R 3.5.0 by xtable 1.8-2 package
%
\begin{tabular}{rrlllr}
\hline
& grade & sex & disadvg & ethnicty & tlimth \\
\hline
1 & 6 & M & YES & HISPANIC & 43 \\
2 & 7 & M & NO & BLACK & 88 \\
3 & 5 & F & YES & HISPANIC & 34 \\
4 & 3 & M & YES & HISPANIC & 65 \\
5 & 8 & M & YES & WHITE & 75 \\
6 & 5 & M & NO & BLACK & 74 \\
7 & 8 & F & YES & HISPANIC & 72 \\
8 & 4 & M & YES & BLACK & 79 \\
9 & 6 & M & NO & WHITE & 88 \\
10 & 7 & M & YES & HISPANIC & 87 \\
\hline
\end{tabular}
What am I supposed to do next to save this table as a PDF?
Thank you for your time.