]> git.donarmstrong.com Git - xtable.git/commitdiff
Whitespace commit, mainly vertical near the beginning, no change in PDF
authorarnima <arnima@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 29 Sep 2014 17:22:12 +0000 (17:22 +0000)
committerarnima <arnima@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 29 Sep 2014 17:22:12 +0000 (17:22 +0000)
git-svn-id: svn://scm.r-forge.r-project.org/svnroot/xtable@58 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/vignettes/xtableGallery.Rnw

index c45370d27efa95936578dbde0918a064d2867e72..7216df4b2156e35622bd22d19b77960e9c48c71e 100644 (file)
@@ -4,16 +4,7 @@
 %\VignettePackage{xtable}\r
 % !Rnw weave = knitr\r
 % \VignetteEngine{knitr::knitr}\r
-\r
 %**************************************************************************\r
-%\r
-% # $Id:$\r
-\r
-% $Revision:  $\r
-% $Author: $\r
-% $Date:  $\r
-\r
-\r
 \documentclass[article, nojss]{jss}\r
 \usepackage{amsthm}\r
 \usepackage{amsmath}\r
 \usepackage{afterpage}\r
 \usepackage{hyperref}\r
 \r
-\title{\r
-The \pkg{xtable} Gallery\r
-}\r
-\author{Jonathan Swinton and others\\\r
-  <jonathan@swintons.net>\r
-}\r
-\r
+\title{The \pkg{xtable} Gallery}\r
+\author{Jonathan Swinton and others\\<jonathan@swintons.net>}\r
 \Plainauthor{Jonathan Swinton, and others} %% comma-separated\r
-\r
 \Plaintitle{The xtable Gallery} %% without formatting\r
-\r
 \Shorttitle{\pkg{xtable} Gallery} %% a short title (if necessary)\r
 \r
 <<include=FALSE>>=\r
 library(knitr)\r
-opts_chunk$set(\r
-fig.path='figdir/fig', debug=TRUE, echo=TRUE\r
-)\r
+opts_chunk$set(fig.path='figdir/fig', debug=TRUE, echo=TRUE)\r
 options(replace.assign = TRUE, width = 60,\r
         tidy.opts = list(width.cutoff = 60))\r
 @\r
@@ -51,25 +33,18 @@ options(replace.assign = TRUE, width = 60,
 %\usepackage{hyperref}\r
 \r
 \Abstract{\r
-\r
   This document gives a gallery of tables which can be made by using\r
   the \texttt{xtable} package to create \LaTeX\ output.  It doubles as\r
   a regression check for the package.\r
-\r
 }\r
 \r
 \Keywords{Reproducible research, \LaTeX}\r
-\r
-\Address{\r
-  Jonathan Swinton\\\r
-  E-mail: \email{jonathan@swintons.net}\r
-}\r
+\Address{Jonathan Swinton\\E-mail: \email{jonathan@swintons.net}}\r
 \r
 \begin{document}\r
 \r
-\r
-\r
 \section{Gallery}\r
+\r
 \subsection{Data frame}\r
 Load example dataset\r
 <<>>=\r
@@ -104,6 +79,7 @@ fm1.table <- xtable(fm1)
 <<results='asis'>>=\r
 fm1.table\r
 @\r
+\r
 \subsection{lm}\r
 <<>>=\r
 fm2 <- lm(tlimth ~ sex*ethnicty, data = tli)\r
@@ -126,11 +102,8 @@ fm2b <- lm(tlimth ~ ethnicty, data = tli)
 xtable(anova(fm2b, fm2))\r
 @\r
 \r
-\r
 \subsection{glm}\r
-\r
 <<>>=\r
-\r
 ## Demonstrate glm\r
 fm3 <- glm(disadvg ~ ethnicty*grade, data = tli, family = binomial())\r
 fm3.table <- xtable(fm3)\r
@@ -144,10 +117,8 @@ fm3.table
 xtable(anova(fm3))\r
 @\r
 \r
-\r
 \subsection{More aov}\r
 <<>>=\r
-\r
 ## Demonstrate aov\r
 ## Taken from help(aov) in R 1.1.1\r
 ## From Venables and Ripley (1997) p.210.\r
@@ -181,14 +152,12 @@ xtable(summary(npk.aov))
 xtable(npk.aovE)\r
 @\r
 \r
-\r
 <<results='asis'>>=\r
 xtable(summary(npk.aovE))\r
 @\r
 \r
 \subsection{More lm}\r
 <<>>=\r
-\r
 ## Demonstrate lm\r
 ## Taken from help(lm) in R 1.1.1\r
 ## Annette Dobson (1990) "An Introduction to Generalized Linear Models".\r
@@ -203,14 +172,12 @@ lm.D9 <- lm(weight ~ group)
 xtable(lm.D9)\r
 @\r
 \r
-\r
 <<results='asis'>>=\r
 xtable(anova(lm.D9))\r
 @\r
 \r
 \subsection{More glm}\r
 <<>>=\r
-\r
 ## Demonstrate glm\r
 ## Taken from help(glm) in R 1.1.1\r
 ## Annette Dobson (1990) "An Introduction to Generalized Linear Models".\r
@@ -238,13 +205,10 @@ if(require(stats, quietly = TRUE)) {
 xtable(pr1)\r
 @\r
 \r
-\r
 <<results='asis'>>=\r
 xtable(summary(pr1))\r
 @\r
 \r
-\r
-\r
 <<echo = FALSE, results = 'Hide'>>=\r
 #  ## Demonstrate princomp\r
 #  ## Taken from help(princomp) in mva package of R 1.1.1\r
@@ -253,7 +217,6 @@ xtable(summary(pr1))
 @\r
 \r
 \subsection{Time series}\r
-\r
 <<>>=\r
 temp.ts <- ts(cumsum(1 + round(rnorm(100), 0)),\r
               start = c(1954, 7), frequency = 12)\r
@@ -309,7 +272,6 @@ x
 Now change the default alignment, digits and display using helper functions\r
 \texttt{xalign}, \texttt{xdigits}, and \texttt{xdisplay}.\r
 \r
-\r
 <<proposed>>=\r
 align(x) <- xalign(x)\r
 digits(x) <- xdigits(x)\r
@@ -323,8 +285,6 @@ This produces a better format as shown below.
 x\r
 @ %def\r
 \r
-\r
-\r
 \section{Sanitization}\r
 <<>>=\r
 insane <- data.frame(Name = c("Ampersand","Greater than","Less than",\r
@@ -353,7 +313,6 @@ print(wanttex,
 @\r
 \r
 \subsection{Markup in tables}\r
-\r
 Markup can be included in tables, including in column and row names, by using\r
 a custom \code{sanitize.text.function()}:\r
 \r
@@ -382,6 +341,7 @@ print(xtable(money), sanitize.rownames.function = function(x) {x})
 @\r
 \r
 \section{Format examples}\r
+\r
 \subsection{Adding a centering environment }\r
 <<results='asis'>>=\r
    print(xtable(lm.D9, caption = "\\tt latex.environments = NULL"),\r
@@ -391,8 +351,8 @@ print(xtable(money), sanitize.rownames.function = function(x) {x})
     print(xtable(lm.D9, caption = "\\tt latex.environments = \"center\""),\r
           latex.environments = "center")\r
 @\r
-\subsection{Column alignment}\r
 \r
+\subsection{Column alignment}\r
 <<>>=\r
 tli.table <- xtable(tli[1:10, ])\r
 @\r
@@ -420,8 +380,6 @@ tli.table
 @\r
 \r
 \subsection{Significant digits}\r
-\r
-\r
 Specify with a single argument\r
 <<>>=\r
 digits(tli.table) <- 3\r
@@ -430,7 +388,6 @@ digits(tli.table) <- 3
 tli.table\r
 @\r
 \r
-\r
 \vspace{12pt}\r
 or one for each column, counting the row names,\r
 <<>>=\r
@@ -494,7 +451,6 @@ print(tli.table, rotate.rownames = TRUE, rotate.colnames = TRUE)
 @\r
 \r
 \subsection{Horizontal lines}\r
-\r
 \vspace{12pt}\textbf{\itshape Line locations}\r
 \r
 Use the \texttt{hline.after} argument to specify the position of the\r
@@ -551,18 +507,15 @@ This command produces the required table.
 print(bktbs, booktabs = TRUE, hline.after = hlines)\r
 @\r
 \r
-\r
 \subsection{Table-level LaTeX}\r
 <<results='asis'>>=\r
 print(xtable(anova(glm.D93)), size = "small")\r
 @\r
 \r
-\r
 \subsection{Long tables}\r
 Remember to insert \verb|\usepackage{longtable}| in your \LaTeX preamble.\r
 \r
 <<longtable>>=\r
-\r
 ## Demonstration of longtable support.\r
 x <- matrix(rnorm(1000), ncol = 10)\r
 x.big <- xtable(x, label = 'tabbig',\r
@@ -676,8 +629,10 @@ x.ltx
 \section{Acknowledgements}\r
 Most of the examples in this gallery are taken from the \texttt{xtable}\r
 documentation.\r
+\r
 \section{R Session information}\r
 <<results='asis'>>=\r
 toLatex(sessionInfo())\r
 @\r
+\r
 \end{document}\r