0

I have a very basic question however I'm stumped.

I am creating a LaTex table in R and I am having trouble with actually outputting the real table.

Here is example code borrowed from: http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf

data(tli)
tli.table <- xtable(tli[1:10,])
print(tli.table,floating=FALSE)

This code just gives me the raw table output:

% latex table generated in R 3.0.3 by xtable 1.7-3 package
% Tue Jul 15 13:23:25 2014
\begin{table}[ht]
\centering
\begin{tabular}{rrlllr}, etc. etc. etc.

How in the world do I actually see the real table that is shown in the above referenced table. The code in that source seems like the above 3 lines produce the table but, for me, it's just producing the raw version.

Forgive the simplicity of this question but I am stumped.

Elizabeth
  • 199
  • 1
  • 4
  • 13
  • 4
    You don't. The purpose of `xtable` is to output the raw LaTeX, which you then put into a .tex document and compile separately (or in a .rnw file and use knitr/sweave). – joran Jul 15 '14 at 17:49
  • @joran. Ok, thanks. That's what I was missing. For some reason the above document made it look like there were no other steps. That was just my general misunderstanding of the process, though. – Elizabeth Jul 15 '14 at 18:35
  • If you download the package source files, you'll find a file called `xtableGallery.snw` that is the Sweave source file that generated that PDF. – joran Jul 15 '14 at 19:16

0 Answers0