[Tex/LaTex] Size of Sweave Output

beamerrsweave

I am very new to LaTeX and Sweave, and I am just playing around with getting some output. That said, the "output" I am getting is very large in size (physcially on the page). For example, one output from a 2×3 crosstab takes up a whole 8.5×11 page. If I try to use the same output in a beamer presentation, maybe 30% of the output fits on 1 slide.

Simply, when pushing output from R using Sweave, how can I control the size of the output?

Thanks in advance!

EDIT: Below is a code snipped within my .Rnw file (before Sweave processing)

<<echo=FALSE>>=
cat("Education by Induced")
cat("\n")
CrossTable(infert$education, infert$induced, expected = TRUE, format="SPSS")
@

Best Answer

You can use the \scalebox{} command that comes with the graphicx package. E.g., with

\scalebox{0.7}{%
\begin{tabular}{...}
...
\end{tabular}}

your text will be printed at 70%.

This will only work if you use a Sweave chunk to create an external file (say, tab1.tex) and then include it in the LATEX file using an \include or \input statement, not by printing it directly into you master file with results=tex.

Update:

Given my comment and your updated question, I would suggest to look at the Design package which offers convenient LaTeX export of nice-looking Tables, see summary.formula(). Again, the idea would be to write a Table generated this way into a TeX file, and then \input it into your master Rnw file. You can look at Statistical Reporting, Linking S Output with Report Documents, Literate Programming, Managing Analyses, and Documenting Programs and Data for more detailed illustrations.