]> git.donarmstrong.com Git - xtable.git/blob - pkg/vignettes/xtableGallery.Rnw
Minimal working version of print.xtableFtable included.
[xtable.git] / pkg / vignettes / xtableGallery.Rnw
1 %\VignetteIndexEntry{xtable Gallery}\r
2 %\VignetteDepends{xtable}\r
3 %\VignetteKeywords{LaTeX, HTML, table}\r
4 %\VignettePackage{xtable}\r
5 % !Rnw weave = knitr\r
6 % \VignetteEngine{knitr::knitr}\r
7 %**************************************************************************\r
8 \documentclass{article}\r
9 \usepackage[a4paper,height=24cm]{geometry} % geometry first\r
10 \usepackage{array}\r
11 \usepackage{booktabs}\r
12 \usepackage{longtable}\r
13 \usepackage{parskip}\r
14 \usepackage{rotating}\r
15 \usepackage{tabularx}\r
16 \usepackage{titlesec}\r
17 \usepackage{hyperref} % hyperref last\r
18 \titleformat\subsubsection{\bfseries\itshape}{}{0pt}{}\r
19 \newcommand\p{\vspace{2ex}}\r
20 \newcommand\code[1]{\texttt{#1}}\r
21 \newcommand\pkg[1]{\textbf{#1}}\r
22 \setcounter{tocdepth}{2}\r
23 \begin{document}\r
24 \r
25 \title{The \pkg{xtable} Gallery}\r
26 \author{Jonathan Swinton and others}\r
27 \maketitle\r
28 \r
29 \tableofcontents\r
30 \r
31 \newpage\r
32 \r
33 \section{Introduction}\r
34 This document gives a gallery of tables which can be made using the\r
35 \pkg{xtable} package to create \LaTeX\ output. It doubles as a\r
36 regression check for the package.\r
37 \r
38 <<include=FALSE>>=\r
39 library(knitr)\r
40 opts_chunk$set(fig.path='figdir/fig', debug=TRUE, echo=TRUE)\r
41 set.seed(1234)\r
42 @\r
43 \r
44 The first step is to load the package and set an option for this document.\r
45 <<results='asis'>>=\r
46 library(xtable)\r
47 options(xtable.floating = FALSE)\r
48 options(xtable.timestamp = "")\r
49 @\r
50 \r
51 \section{Gallery}\r
52 \subsection{Data frame}\r
53 <<results='asis'>>=\r
54 data(tli)\r
55 xtable(tli[1:10, ])\r
56 @\r
57 \r
58 \subsection{Matrix}\r
59 <<results='asis'>>=\r
60 design.matrix <- model.matrix(~ sex*grade, data = tli[1:10, ])\r
61 xtable(design.matrix, digits = 0)\r
62 @\r
63 \r
64 \newpage\r
65 \subsection{aov}\r
66 <<results='asis'>>=\r
67 fm1 <- aov(tlimth ~ sex + ethnicty + grade + disadvg, data = tli)\r
68 xtable(fm1)\r
69 @\r
70 \r
71 \subsection{lm}\r
72 <<results='asis'>>=\r
73 fm2 <- lm(tlimth ~ sex*ethnicty, data = tli)\r
74 xtable(fm2)\r
75 @\r
76 \r
77 \subsubsection{Anova table (one model)}\r
78 <<results='asis'>>=\r
79 xtable(anova(fm2))\r
80 @\r
81 \r
82 \subsubsection{Anova table (two models)}\r
83 <<results='asis'>>=\r
84 fm2b <- lm(tlimth ~ ethnicty, data = tli)\r
85 xtable(anova(fm2b, fm2))\r
86 @\r
87 \r
88 \newpage\r
89 \subsection{glm}\r
90 <<results='asis'>>=\r
91 fm3 <- glm(disadvg ~ ethnicty*grade, data = tli, family = binomial)\r
92 xtable(fm3)\r
93 @\r
94 \r
95 \subsubsection{Analysis of deviance}\r
96 <<results='asis'>>=\r
97 xtable(anova(fm3))\r
98 @\r
99 \r
100 \subsection{prcomp}\r
101 <<results='asis'>>=\r
102 pr1 <- prcomp(USArrests)\r
103 xtable(pr1)\r
104 @\r
105 \r
106 \p\r
107 <<results='asis'>>=\r
108 xtable(summary(pr1))\r
109 @\r
110 \r
111 <<include=FALSE>>=\r
112 # pr2 <- princomp(USArrests)\r
113 # xtable(pr2)\r
114 @\r
115 \r
116 \newpage\r
117 \r
118 \subsection{Time series}\r
119 <<results='asis'>>=\r
120 temp.ts <- ts(cumsum(1 + round(rnorm(100), 0)),\r
121               start = c(1954, 7), frequency = 12)\r
122 temp.table <- xtable(temp.ts, digits = 0)\r
123 temp.table\r
124 @\r
125 \r
126 \newpage\r
127 \r
128 <<include=FALSE>>=\r
129 # ## Demonstrate saving to file\r
130 # for(i in c("latex", "html")) {\r
131 #   outFileName <- paste("xtable.", ifelse(i=="latex", "tex", i), sep = "")\r
132 #   print(xtable(lm.D9), type = i, file = outFileName, append = TRUE,\r
133 #         latex.environments = NULL)\r
134 #   print(xtable(lm.D9), type = i, file = outFileName, append = TRUE,\r
135 #         latex.environments = "")\r
136 #   print(xtable(lm.D9), type = i, file = outFileName, append = TRUE,\r
137 #         latex.environments = "center")\r
138 #   print(xtable(anova(glm.D93, test = "Chisq")),\r
139 #         type = i, file = outFileName,\r
140 #         append = TRUE)\r
141 #   print(xtable(anova(glm.D93)), hline.after = c(1),\r
142 #         size = "small", type = i,\r
143 #         file = outFileName, append = TRUE)\r
144 #   # print(xtable(pr2), type = i, file = outFileName, append = TRUE)\r
145 # }\r
146 @\r
147 \r
148 \section{Automatic formatting}\r
149 \subsection{Suggest alignment, digits, and display}\r
150 The functions \code{xalign}, \code{xdigits}, and \code{xdisplay} are useful for\r
151 formatting tables in a sensible way. Consider the output produced by the default\r
152 formatting.\r
153 \r
154 <<results='asis'>>=\r
155 dat <- mtcars[1:3, 1:6]\r
156 x <- xtable(dat)\r
157 x\r
158 @\r
159 \r
160 \p\r
161 Now change the default alignment, digits and display using helper functions\r
162 \code{xalign}, \code{xdigits}, and \code{xdisplay}. This produces a better\r
163 format as shown below.\r
164 \r
165 <<results='asis'>>=\r
166 align(x) <- xalign(x)\r
167 digits(x) <- xdigits(x)\r
168 display(x) <- xdisplay(x)\r
169 x\r
170 @\r
171 \r
172 \subsection{Shorthand notation}\r
173 For convenience, the three `autoformat' functions (\code{xalign},\r
174 \code{xdigits}, and \code{xdisplay}) can be applied together when an\r
175 \code{xtable} is created, using the \code{auto} argument:\r
176 \r
177 <<results='asis'>>=\r
178 xtable(dat, auto = TRUE)\r
179 @\r
180 \r
181 \p\r
182 Similarly, the \code{autoformat} function can be used to postprocess an\r
183 existing \code{xtable}:\r
184 \r
185 <<results='asis'>>=\r
186 x <- xtable(dat)\r
187 autoformat(x)\r
188 @\r
189 \r
190 \newpage\r
191 \r
192 \subsection{Math-Style Exponents}\r
193 If you prefer $5 \times 10^5$ in your tables to 5e5, the\r
194 \code{math.style.exponents} option to \code{print.xtable} is useful:\r
195 \r
196 <<results='asis'>>=\r
197 print(xtable(data.frame(text = c("foo","bar"),\r
198                         googols = c(10e10,50e10),\r
199                         small = c(8e-24,7e-5),\r
200                         row.names = c("A","B")),\r
201              display = c("s","s","g","g")),\r
202       math.style.exponents = TRUE)\r
203\r
204 \r
205 this option also supports the values \code{ensuremath} which uses\r
206 \code{\char`\\ensuremath} instead of \code{\$\$} and \code{UTF-8}\r
207 which uses UTF-8 to approximate the \LaTeX typesetting.\r
208 \r
209 \r
210 \section{Sanitization}\r
211 <<results='asis'>>=\r
212 insane <- data.frame(Name = c("Ampersand","Greater than","Less than",\r
213                             "Underscore","Per cent","Dollar",\r
214                             "Backslash","Hash","Caret","Tilde",\r
215                             "Left brace","Right brace"),\r
216                      Character = I(c("&",">","<","_","%","$",\r
217                                      "\\","#","^","~","{","}")))\r
218 colnames(insane)[2] <- paste(insane[, 2], collapse = "")\r
219 xtable(insane)\r
220 @\r
221 \r
222 \p\r
223 Sometimes you might want to have your own sanitization function.\r
224 \r
225 \r
226 <<results='asis'>>=\r
227 wanttex <- xtable(data.frame(Column =\r
228                              paste("Value_is $10^{-",1:3,"}$", sep = "")))\r
229 print(wanttex, sanitize.text.function =\r
230       function(str) gsub("_", "\\_", str, fixed = TRUE))\r
231 @\r
232 \r
233 \p\r
234 Sanitization can be useful in formatting column headings and row names:\r
235 \r
236 <<sanitize3>>=\r
237 dat <- mtcars[1:3, 1:6]\r
238 large <- function(x){\r
239   paste0('{\\Large{\\bfseries ', x, '}}')\r
240 }\r
241 italic <- function(x){\r
242   paste0('{\\emph{ ', x, '}}')\r
243 }\r
244 @ %def\r
245 \r
246 <<sanitize4, results = 'asis'>>=\r
247 print(xtable(dat),\r
248       sanitize.rownames.function = italic,\r
249       sanitize.colnames.function = large,\r
250       booktabs = TRUE)\r
251 @ %def\r
252 \r
253 \r
254 \r
255 \newpage\r
256 \r
257 \subsection{Markup in tables}\r
258 Markup can be included in tables, including in column and row names, by using\r
259 a custom \code{sanitize.text.function}.\r
260 \r
261 <<results='asis'>>=\r
262 mat <- round(matrix(c(0.9, 0.89, 200, 0.045, 2.0), c(1, 5)), 4)\r
263 rownames(mat) <- "$y_{t-1}$"\r
264 colnames(mat) <- c("$R^2$", "$\\bar{x}$", "F-stat", "S.E.E", "DW")\r
265 mat <- xtable(mat)\r
266 print(mat, sanitize.text.function = function(x) {x})\r
267 @\r
268 \r
269 % By David Dahl to demonstrate contribution from David Whitting, 2007-10-09.\r
270 \p\r
271 You can also have sanitize functions that are specific to column or\r
272 row names.  In the table below, the row name is not sanitized but\r
273 column names and table elements are.\r
274 \r
275 <<results='asis'>>=\r
276 money <- matrix(c("$1,000","$900","$100"), ncol = 3,\r
277                 dimnames = list("$\\alpha$",\r
278                                 c("Income (US$)","Expenses (US$)",\r
279                                   "Profit (US$)")))\r
280 print(xtable(money), sanitize.rownames.function = function(x) {x})\r
281 @\r
282 \r
283 \section{Format examples}\r
284 \subsection{Adding a centering environment}\r
285 <<results='asis'>>=\r
286 print(xtable(anova(fm3), caption = "\\tt latex.environments = \"\""),\r
287       floating = TRUE, latex.environments = "")\r
288 print(xtable(anova(fm3), caption = "\\tt latex.environments = \"center\""),\r
289       floating = TRUE, latex.environments = "center")\r
290 @\r
291 \r
292 \newpage\r
293 \r
294 \subsection{Column alignment}\r
295 <<results='asis'>>=\r
296 tli.table <- xtable(tli[1:10, ])\r
297 align(tli.table) <- rep("r", 6)\r
298 tli.table\r
299 @\r
300 \r
301 \subsubsection{Left aligned strings with column lines}\r
302 <<results='asis'>>=\r
303 align(tli.table) <- "|rrl|l|lr|"\r
304 tli.table\r
305 @\r
306 \r
307 \subsubsection{Fixed width columns}\r
308 <<results='asis'>>=\r
309 align(tli.table) <- "|rr|lp{3cm}l|r|"\r
310 tli.table\r
311 @\r
312 \r
313 \newpage\r
314 \r
315 \subsection{Number of digits}\r
316 One number for all columns,\r
317 <<results='asis'>>=\r
318 display(tli.table)[c(2,6)] <- "f"\r
319 digits(tli.table) <- 3\r
320 tli.table\r
321 @\r
322 \r
323 \p\r
324 or one for each column, including the row names,\r
325 <<results='asis'>>=\r
326 digits(tli.table) <- 1:(ncol(tli)+1)\r
327 tli.table\r
328 @\r
329 \r
330 \p\r
331 or as a full matrix.\r
332 <<results='asis'>>=\r
333 digits(tli.table) <- matrix(0:4, nrow = 10, ncol = ncol(tli)+1)\r
334 tli.table\r
335 @\r
336 \r
337 \newpage\r
338 \r
339 \subsection{Suppress row/column names}\r
340 \subsubsection{Suppress row names}\r
341 <<results='asis'>>=\r
342 tli.table <- xtable(tli[1:10, ])\r
343 print(tli.table, include.rownames = FALSE)\r
344 @\r
345 \r
346 \p\r
347 If you want a vertical line on the left, you need to change the \code{align}\r
348 attribute.\r
349 <<results='asis'>>=\r
350 align(tli.table) <- "|r|r|lp{3cm}l|r|"\r
351 print(tli.table, include.rownames = FALSE)\r
352 @\r
353 \r
354 \p\r
355 Revert the alignment to what is was before.\r
356 <<>>=\r
357 align(tli.table) <- "|rr|lp{3cm}l|r|"\r
358 @\r
359 \r
360 \newpage\r
361 \r
362 \subsubsection{Suppress column names}\r
363 <<results='asis'>>=\r
364 print(tli.table, include.colnames = FALSE)\r
365 @\r
366 \r
367 \p\r
368 Note the doubled header lines which can be suppressed.\r
369 <<results='asis'>>=\r
370 print(tli.table, include.colnames = FALSE,\r
371       hline.after = c(0,nrow(tli.table)))\r
372 @\r
373 \r
374 \subsubsection{Suppress row and column names}\r
375 <<results='asis'>>=\r
376 print(tli.table, include.colnames = FALSE, include.rownames = FALSE)\r
377 @\r
378 \r
379 \newpage\r
380 \r
381 \subsection{Rotate row/column names}\r
382 The \code{rotate.rownames} and \code{rotate.colnames} arguments can be used to\r
383 rotate the row and/or column names. This requires \verb|\usepackage{rotating}|\r
384 in the \LaTeX\ preamble.\r
385 \r
386 <<results='asis'>>=\r
387 print(tli.table, rotate.rownames = TRUE, rotate.colnames = TRUE)\r
388 @\r
389 \r
390 \newpage\r
391 \r
392 \subsection{Horizontal lines}\r
393 \subsubsection{Line locations}\r
394 Use the \code{hline.after} argument to specify the position of the\r
395 horizontal lines.\r
396 \r
397 <<results='asis'>>=\r
398 print(xtable(anova(fm3)), hline.after = c(1))\r
399 @\r
400 \r
401 \subsubsection{Line styles}\r
402 Specifying \code{booktabs = TRUE} will generate three line types. By default,\r
403 when no value is given for \code{hline.after}, a \verb|\toprule| will be drawn\r
404 above the table, a \verb|\midrule| after the table headings and a\r
405 \verb|\bottomrule| below the table. This requires \verb|\usepackage{booktabs}|\r
406 in the \LaTeX\ preamble.\r
407 \r
408 \p\r
409 The top and bottom rules are slightly thicker than the mid rule. The thickness\r
410 of the lines can be set via the \LaTeX\ lengths \verb|\heavyrulewidth| and\r
411 \verb|\lightrulewidth|.\r
412 \r
413 <<results='asis'>>=\r
414 tli.table <- xtable(tli[1:10, ])\r
415 print(tli.table, include.rownames = FALSE, booktabs = TRUE)\r
416 @\r
417 \r
418 \p\r
419 If \code{hline.after} includes \code{-1}, a \verb|\toprule| will be\r
420 drawn above the table. If \code{hline.after} includes the number of\r
421 rows in the table, a \verb|\bottomrule| will be drawn below the\r
422 table. For any other values specified in \code{hline.after}, a\r
423 \verb|\midrule| will be drawn after that line of the table.\r
424 \r
425 \p\r
426 The following table has more than one \verb|\midrule|.\r
427 \r
428 <<results='asis'>>=\r
429 bktbs <- xtable(matrix(1:10, ncol = 2))\r
430 hlines <- c(-1, 0, 1, nrow(bktbs))\r
431 print(bktbs, booktabs = TRUE, hline.after = hlines)\r
432 @\r
433 \r
434 \subsection{Table level commands}\r
435 <<results='asis'>>=\r
436 print(xtable(anova(fm3)), size = "large")\r
437 @\r
438 \r
439 \p\r
440 <<results='asis'>>=\r
441 print(xtable(anova(fm3)), size = "\\setlength{\\tabcolsep}{12pt}")\r
442 @\r
443 \r
444 \subsection{Long tables}\r
445 Requires \verb|\usepackage{longtable}| in the \LaTeX\ preamble.\r
446 \r
447 <<results='asis'>>=\r
448 x <- matrix(rnorm(1000), ncol = 10)\r
449 x.big <- xtable(x, caption = "A \\code{longtable} spanning several pages")\r
450 print(x.big, hline.after=c(-1, 0), tabular.environment = "longtable")\r
451 @\r
452 \r
453 Extra features of the \pkg{longtable} \LaTeX{} package can typically\r
454 be activated using \code{add.to.row}, as shown below.\r
455 \r
456 <<results='asis'>>=\r
457 add.to.row <- list(pos = list(0), command = NULL)\r
458 command <- paste0("\\hline\n\\endhead\n",\r
459                   "\\hline\n",\r
460                   "\\multicolumn{", dim(x)[2] + 1, "}{l}",\r
461                   "{\\footnotesize Continued on next page}\n",\r
462                   "\\endfoot\n",\r
463                   "\\endlastfoot\n") \r
464 add.to.row$command <- command\r
465 print(x.big, hline.after=c(-1), add.to.row = add.to.row,\r
466       tabular.environment = "longtable")\r
467 @\r
468 \r
469 \r
470 \newpage\r
471 \r
472 \subsection{Use of \code{add.to.row} argument}\r
473 The following frequency table has outer dimnames: \code{Grade3} and\r
474 \code{Grade6}.\r
475 \r
476 <<>>=\r
477 Grade3 <- c("A","B","B","A","B","C","C","D","A","B",\r
478             "C","C","C","D","B","B","D","C","C","D")\r
479 Grade6 <- c("A","A","A","B","B","B","B","B","C","C",\r
480             "A","C","C","C","D","D","D","D","D","D")\r
481 Cohort <- table(Grade3, Grade6)\r
482 Cohort\r
483 @\r
484 \r
485 \p\r
486 The default behavior of \code{print.xtable} is to strip outer dimnames.\r
487 <<results='asis'>>=\r
488 xtable(Cohort)\r
489 @\r
490 \r
491 \p\r
492 The desired column labels can be created using \code{add.to.row}, in this case\r
493 applying two commands to ``row number zero'' while suppressing the basic column\r
494 names.\r
495 \r
496 <<results='asis'>>=\r
497 addtorow <- list()\r
498 addtorow$pos <- list(0, 0)\r
499 addtorow$command <- c("& \\multicolumn{4}{c}{Grade 6} \\\\\n",\r
500                       "Grade 3 & A & B & C & D \\\\\n")\r
501 print(xtable(Cohort), add.to.row = addtorow, include.colnames = FALSE)\r
502 @\r
503 \r
504 \subsection{Sideways tables}\r
505 Requires \verb|\usepackage{rotating}| in the LaTeX\r
506 preamble.  Sideways tables can't be forced in place with the \code{[H]}\r
507 specifier, but you can use the \verb|\clearpage| command to get them\r
508 fairly nearby.\r
509 \r
510 <<results='asis'>>=\r
511 x <- x[1:30, ]\r
512 x.side <- xtable(x, caption = "A sideways table")\r
513 print(x.side, floating = TRUE, floating.environment = "sidewaystable")\r
514 @\r
515 \clearpage\r
516 \r
517 \subsection{Rescaled tables}\r
518 Specify a \code{scalebox} value to rescale the table.\r
519 <<results='asis'>>=\r
520 x <- x[1:20, ]\r
521 x.rescale <- xtable(x)\r
522 print(x.rescale, scalebox = 0.7)\r
523 @\r
524 \r
525 \subsection{Aligning fixed width columns}\r
526 Note that using specifications such as \verb|p{2cm}| always\r
527 produces a \textbf{left aligned} column. What if some other alignment\r
528 is desired?\r
529 \r
530 This is not really a problem with \pkg{xtable} but with the formatting\r
531 of tables with fixed width columns and different alignments using\r
532 standard \LaTeX.\r
533 \r
534 One solution is to use the \verb|array| package, defining new\r
535 column formats.\r
536 \r
537 \begin{verbatim}\r
538 \newcolumntype{L}[1]{>{\raggedright\let\newline\\\r
539     \arraybackslash\hspace{0pt}}m{#1}}\r
540 \newcolumntype{C}[1]{>{\centering\let\newline\\\r
541     \arraybackslash\hspace{0pt}}m{#1}}\r
542 \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\r
543     \arraybackslash\hspace{0pt}}m{#1}}\r
544 \newcolumntype{P}[1]{>{\raggedright\tabularxbackslash}p{#1}}\r
545 \end{verbatim}\r
546 \r
547 These allow for very sophisticated cell formatting, namely\r
548 left-aligned, centred, or right-aligned text, with recognition of line\r
549 breaks for the first three new column types. If these lines are\r
550 included along with \verb|\usepackage{array}|, then the following\r
551 is possible.\r
552 \r
553 \newcolumntype{L}[1]{>{\raggedright\let\newline\\\r
554     \arraybackslash\hspace{0pt}}m{#1}}\r
555 \newcolumntype{C}[1]{>{\centering\let\newline\\\r
556     \arraybackslash\hspace{0pt}}m{#1}}\r
557 \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\r
558     \arraybackslash\hspace{0pt}}m{#1}}\r
559 \newcolumntype{P}[1]{>{\raggedright\tabularxbackslash}p{#1}}\r
560 \r
561 <<results='asis'>>=\r
562 df <- data.frame(name = c("A","B"), right = c(1.4, 34.6),\r
563                  left = c(1.4, 34.6), text = c("txt1","txt2"))\r
564 print(xtable(df, align = c("l", "|c", "|R{3cm}", "|L{3cm}", "| p{3cm}|")),\r
565       floating = FALSE, include.rownames = FALSE)\r
566 @\r
567 \r
568 \newpage\r
569 \r
570 \subsection{Table width}\r
571 The \code{tabularx} environment is for typesetting tables whose overall width is\r
572 fixed. The column alignment code \code{X} denotes columns that will be stretched\r
573 to achieve the desired table width. Requires \verb|\usepackage{tabularx}| in the\r
574 \LaTeX\ preamble.\r
575 \r
576 <<results='asis'>>=\r
577 df.width <- data.frame(One = c("item 1", "A"), Two = c("item 2", "B"),\r
578                        Three = c("item 3", "C"), Four = c("item 4", "D"))\r
579 x.width <- xtable(df.width)\r
580 align(x.width) <- "|l|X|l|l|l|"\r
581 print(x.width, tabular.environment = "tabularx", width = "\\textwidth")\r
582 @\r
583 \r
584 \section{Suppressing printing}\r
585 By default the \code{print} method will print the \LaTeX\ or HTML to standard\r
586 output and also return the character strings invisibly.  The printing to\r
587 standard output can be suppressed by specifying \code{print.results = FALSE}.\r
588 \r
589 <<>>=\r
590 x.out <- print(tli.table, print.results = FALSE)\r
591 @\r
592 \r
593 Formatted output can also be captured without printing with the\r
594 \code{toLatex} method.  This function returns an object of class\r
595 \code{"Latex"}.\r
596 \r
597 <<>>=\r
598 x.ltx <- toLatex(tli.table)\r
599 class(x.ltx)\r
600 x.ltx\r
601 @\r
602 \r
603 \newpage\r
604 \r
605 \section{Acknowledgements}\r
606 Most of the examples in this gallery are taken from the \pkg{xtable}\r
607 documentation. Two examples (\code{add.to.row} and `Aligning fixed width\r
608 columns') are from Stack Exchange.\r
609 \r
610 \section{Session information}\r
611 <<results='asis'>>=\r
612 toLatex(sessionInfo())\r
613 @\r
614 \r
615 \end{document}\r