library(xtable) ?xtable # Load example dataset data(tli) ## Demonstrate data.frame tli.table <- xtable(tli[1:20, ]) digits(tli.table)[c(2, 6)] <- 0 print(tli.table) print(tli.table, type = "html") ## Demonstrate data.frame with different digits in cells tli.table <- xtable(tli[1:20, ]) digits(tli.table) <- matrix( 0:4, nrow = 20, ncol = ncol(tli)+1 ) print(tli.table) print(tli.table, type = "html") ## Demonstrate matrix design.matrix <- model.matrix(~ sex*grade, data = tli[1:20, ]) design.table <- xtable(design.matrix) print(design.table) print(design.table, type = "html") ## Demonstrate aov fm1 <- aov(tlimth ~ sex + ethnicty + grade + disadvg, data = tli) fm1.table <- xtable(fm1) print(fm1.table) print(fm1.table, type = "html") ## Demonstrate lm fm2 <- lm(tlimth ~ sex*ethnicty, data = tli) fm2.table <- xtable(fm2) print(fm2.table) print(fm2.table, type = "html") print(xtable(anova(fm2))) print(xtable(anova(fm2)), type = "html") fm2b <- lm(tlimth ~ ethnicty, data = tli) print(xtable(anova(fm2b, fm2))) print(xtable(anova(fm2b, fm2)), type = "html") ## Demonstrate glm fm3 <- glm(disadvg ~ ethnicty*grade, data = tli, family = binomial()) fm3.table <- xtable(fm3) print(fm3.table) print(fm3.table, type = "html") print(xtable(anova(fm3))) print(xtable(anova(fm3)), type = "html") ## Demonstrate aov ## Taken from help(aov) in R 1.1.1 ## From Venables and Ripley (1997) p.210. N <- c(0,1,0,1,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,0) P <- c(1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0) K <- c(1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0) yield <- c(49.5,62.8,46.8,57.0,59.8,58.5,55.5,56.0,62.8,55.8,69.5,55.0, 62.0,48.8,45.5,44.2,52.0,51.5,49.8,48.8,57.2,59.0,53.2,56.0) npk <- data.frame(block = gl(6,4), N = factor(N), P = factor(P), K = factor(K), yield = yield) npk.aov <- aov(yield ~ block + N*P*K, npk) op <- options(contrasts = c("contr.helmert", "contr.treatment")) npk.aovE <- aov(yield ~ N*P*K + Error(block), npk) options(op) summary(npk.aov) print(xtable(npk.aov)) print(xtable(anova(npk.aov))) print(xtable(summary(npk.aov))) summary(npk.aovE) print(xtable(npk.aovE), type = "html") print(xtable(summary(npk.aovE)), type = "html") ## Demonstrate lm ## Taken from help(lm) in R 1.1.1 ## Annette Dobson (1990) "An Introduction to Generalized Linear Models". ## Page 9: Plant Weight Data. ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2,10,20, labels = c("Ctl","Trt")) weight <- c(ctl, trt) lm.D9 <- lm(weight ~ group) print(xtable(lm.D9)) print(xtable(anova(lm.D9))) ## Demonstrate glm ## Taken from help(glm) in R 1.1.1 ## Annette Dobson (1990) "An Introduction to Generalized Linear Models". ## Page 93: Randomized Controlled Trial : counts <- c(18,17,15,20,10,20,25,13,12) outcome <- gl(3,1,9) treatment <- gl(3,3) d.AD <- data.frame(treatment, outcome, counts) glm.D93 <- glm(counts ~ outcome + treatment, family = poisson()) print(xtable(glm.D93, align = "r|llrc")) print(xtable(anova(glm.D93)), hline.after = c(1), size = "small") ## Demonstration of additional formatC() arguments. print(fm1.table, format.args = list(big.mark = "'", decimal.mark = ",")) ## Demonstration of "short caption" support. fm1sc <- aov(tlimth ~ sex + ethnicty + grade, data = tli) fm1sc.table <- xtable(fm1sc, caption = c("ANOVA Model with Predictors Sex, Ethnicity, and Grade", "ANOVA: Sex, Ethnicity, Grade")) print(fm1sc.table) ## Demonstration of longtable support. ## Remember to insert \usepackage{longtable} on your LaTeX preamble x <- matrix(rnorm(1000), ncol = 10) x.big <- xtable(x, label = 'tabbig', caption = 'Example of longtable spanning several pages') print(x.big, tabular.environment = 'longtable', floating = FALSE) x <- x[1:30, ] x.small <- xtable(x, label = 'tabsmall', caption = 'regular table env') print(x.small) # default, no longtable ## Demonstration of sidewaystable support. ## Remember to insert \usepackage{rotating} on your LaTeX preamble print(x.small, floating.environment = 'sidewaystable') if(require(stats, quietly = TRUE)) { ## Demonstrate prcomp ## Taken from help(prcomp) in mva package of R 1.1.1 data(USArrests) pr1 <- prcomp(USArrests) print(xtable(pr1)) print(xtable(summary(pr1))) # ## Demonstrate princomp # ## Taken from help(princomp) in mva package of R 1.1.1 # pr2 <- princomp(USArrests) # print(xtable(pr2)) } ## Demonstrate include.rownames, include.colnames, ## only.contents and add.to.row arguments set.seed(2345) res <- matrix(sample(0:9, size = 6*9, replace = TRUE), ncol = 6, nrow = 9) xres <- xtable(res) digits(xres) <- rep(0, 7) addtorow <- list() addtorow$pos <- list() addtorow$pos[[1]] <- c(0, 2) addtorow$pos[[2]] <- 4 addtorow$command <- c('\vspace{2mm} \n', '\vspace{10mm} \n') print(xres, add.to.row = addtorow, include.rownames = FALSE, include.colnames = TRUE, only.contents = TRUE, hline.after = c(0, 0, 9, 9)) ## Demonstrate include.rownames, include.colnames, ## only.contents and add.to.row arguments in Rweave files ## Not run: \begin{small} \setlongtables \begin{longtable}{ <>= cat(paste(c('c', rep('cc', 34/2-1), 'c'), collapse = '@{\hspace{2pt}}')) @ } \hline \endhead \hline \endfoot <>= library(xtable) set.seed(2345) res <- matrix(sample(0:9, size = 34*90, replace = TRUE), ncol = 34, nrow = 90) xres <- xtable(res) digits(xres) <- rep(0, 35) addtorow <- list() addtorow$pos <- list() addtorow$pos[[1]] <- c(seq(4, 40, 5), seq(49, 85, 5)) addtorow$pos[[2]] <- 45 addtorow$command <- c('\vspace{2mm} \n', '\newpage \n') print(xres, add.to.row = addtorow, include.rownames = FALSE, include.colnames = FALSE, only.contents = TRUE, hline.after = NULL) @ \end{longtable} \end{small} ########################################################################## ########################################################################## ########################################################################## resultados \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 \\ 11 & 3 & M & NO & WHITE & 79 \\ 12 & 6 & F & NO & WHITE & 84 \\ 13 & 8 & M & NO & WHITE & 90 \\ 14 & 5 & M & NO & WHITE & 73 \\ 15 & 8 & F & NO & WHITE & 72 \\ 16 & 6 & F & NO & BLACK & 82 \\ 17 & 4 & M & NO & WHITE & 69 \\ 18 & 3 & F & YES & HISPANIC & 17 \\ 19 & 3 & M & NO & HISPANIC & 37 \\ 20 & 5 & M & NO & WHITE & 70 \\ \hline \end{tabular} \end{table} > print(tli.table, type = "html")
grade sex disadvg ethnicty tlimth
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
11 3 M NO WHITE 79
12 6 F NO WHITE 84
13 8 M NO WHITE 90
14 5 M NO WHITE 73
15 8 F NO WHITE 72
16 6 F NO BLACK 82
17 4 M NO WHITE 69
18 3 F YES HISPANIC 17
19 3 M NO HISPANIC 37
20 5 M NO WHITE 70
> > ## Demonstrate matrix > design.matrix <- model.matrix(~ sex*grade, data = tli[1:20, ]) > design.table <- xtable(design.matrix) > print(design.table) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{rrrrr} \hline & (Intercept) & sexM & grade & sexM:grade \\ \hline 1 & 1.00 & 1.00 & 6.00 & 6.00 \\ 2 & 1.00 & 1.00 & 7.00 & 7.00 \\ 3 & 1.00 & 0.00 & 5.00 & 0.00 \\ 4 & 1.00 & 1.00 & 3.00 & 3.00 \\ 5 & 1.00 & 1.00 & 8.00 & 8.00 \\ 6 & 1.00 & 1.00 & 5.00 & 5.00 \\ 7 & 1.00 & 0.00 & 8.00 & 0.00 \\ 8 & 1.00 & 1.00 & 4.00 & 4.00 \\ 9 & 1.00 & 1.00 & 6.00 & 6.00 \\ 10 & 1.00 & 1.00 & 7.00 & 7.00 \\ 11 & 1.00 & 1.00 & 3.00 & 3.00 \\ 12 & 1.00 & 0.00 & 6.00 & 0.00 \\ 13 & 1.00 & 1.00 & 8.00 & 8.00 \\ 14 & 1.00 & 1.00 & 5.00 & 5.00 \\ 15 & 1.00 & 0.00 & 8.00 & 0.00 \\ 16 & 1.00 & 0.00 & 6.00 & 0.00 \\ 17 & 1.00 & 1.00 & 4.00 & 4.00 \\ 18 & 1.00 & 0.00 & 3.00 & 0.00 \\ 19 & 1.00 & 1.00 & 3.00 & 3.00 \\ 20 & 1.00 & 1.00 & 5.00 & 5.00 \\ \hline \end{tabular} \end{table} > print(design.table, type = "html")
(Intercept) sexM grade sexM:grade
1 1.00 1.00 6.00 6.00
2 1.00 1.00 7.00 7.00
3 1.00 0.00 5.00 0.00
4 1.00 1.00 3.00 3.00
5 1.00 1.00 8.00 8.00
6 1.00 1.00 5.00 5.00
7 1.00 0.00 8.00 0.00
8 1.00 1.00 4.00 4.00
9 1.00 1.00 6.00 6.00
10 1.00 1.00 7.00 7.00
11 1.00 1.00 3.00 3.00
12 1.00 0.00 6.00 0.00
13 1.00 1.00 8.00 8.00
14 1.00 1.00 5.00 5.00
15 1.00 0.00 8.00 0.00
16 1.00 0.00 6.00 0.00
17 1.00 1.00 4.00 4.00
18 1.00 0.00 3.00 0.00
19 1.00 1.00 3.00 3.00
20 1.00 1.00 5.00 5.00
> > ## Demonstrate aov > fm1 <- aov(tlimth ~ sex + ethnicty + grade + disadvg, data = tli) > fm1.table <- xtable(fm1) > print(fm1.table) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrr} \hline & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ \hline sex & 1 & 75.37 & 75.37 & 0.38 & 0.5417 \\ ethnicty & 3 & 2572.15 & 857.38 & 4.27 & 0.0072 \\ grade & 1 & 36.31 & 36.31 & 0.18 & 0.6717 \\ disadvg & 1 & 59.30 & 59.30 & 0.30 & 0.5882 \\ Residuals & 93 & 18682.87 & 200.89 & & \\ \hline \end{tabular} \end{table} > print(fm1.table, type = "html")
Df Sum Sq Mean Sq F value Pr(>F)
sex 1 75.37 75.37 0.38 0.5417
ethnicty 3 2572.15 857.38 4.27 0.0072
grade 1 36.31 36.31 0.18 0.6717
disadvg 1 59.30 59.30 0.30 0.5882
Residuals 93 18682.87 200.89
> > ## Demonstrate lm > fm2 <- lm(tlimth ~ sex*ethnicty, data = tli) > fm2.table <- xtable(fm2) > print(fm2.table) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{rrrrr} \hline & Estimate & Std. Error & t value & Pr($>$$|$t$|$) \\ \hline (Intercept) & 73.6364 & 4.2502 & 17.33 & 0.0000 \\ sexM & -1.6364 & 5.8842 & -0.28 & 0.7816 \\ ethnictyHISPANIC & -9.7614 & 6.5501 & -1.49 & 0.1395 \\ ethnictyOTHER & 15.8636 & 10.8360 & 1.46 & 0.1466 \\ ethnictyWHITE & 4.7970 & 4.9687 & 0.97 & 0.3368 \\ sexM:ethnictyHISPANIC & 10.6780 & 8.7190 & 1.22 & 0.2238 \\ sexM:ethnictyWHITE & 5.1230 & 7.0140 & 0.73 & 0.4670 \\ \hline \end{tabular} \end{table} > print(fm2.table, type = "html")
Estimate Std. Error t value Pr(>|t|)
(Intercept) 73.6364 4.2502 17.33 0.0000
sexM -1.6364 5.8842 -0.28 0.7816
ethnictyHISPANIC -9.7614 6.5501 -1.49 0.1395
ethnictyOTHER 15.8636 10.8360 1.46 0.1466
ethnictyWHITE 4.7970 4.9687 0.97 0.3368
sexM:ethnictyHISPANIC 10.6780 8.7190 1.22 0.2238
sexM:ethnictyWHITE 5.1230 7.0140 0.73 0.4670
> print(xtable(anova(fm2))) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrr} \hline & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ \hline sex & 1 & 75.37 & 75.37 & 0.38 & 0.5395 \\ ethnicty & 3 & 2572.15 & 857.38 & 4.31 & 0.0068 \\ sex:ethnicty & 2 & 298.43 & 149.22 & 0.75 & 0.4748 \\ Residuals & 93 & 18480.04 & 198.71 & & \\ \hline \end{tabular} \end{table} > print(xtable(anova(fm2)), type = "html")
Df Sum Sq Mean Sq F value Pr(>F)
sex 1 75.37 75.37 0.38 0.5395
ethnicty 3 2572.15 857.38 4.31 0.0068
sex:ethnicty 2 298.43 149.22 0.75 0.4748
Residuals 93 18480.04 198.71
> fm2b <- lm(tlimth ~ ethnicty, data = tli) > print(xtable(anova(fm2b, fm2))) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrrr} \hline & Res.Df & RSS & Df & Sum of Sq & F & Pr($>$F) \\ \hline 1 & 96 & 19053.59 & & & & \\ 2 & 93 & 18480.04 & 3 & 573.55 & 0.96 & 0.4141 \\ \hline \end{tabular} \end{table} > print(xtable(anova(fm2b, fm2)), type = "html")
Res.Df RSS Df Sum of Sq F Pr(>F)
1 96 19053.59
2 93 18480.04 3 573.55 0.96 0.4141
> > ## Demonstrate glm > fm3 <- glm(disadvg ~ ethnicty*grade, data = tli, family = binomial()) > fm3.table <- xtable(fm3) > print(fm3.table) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{rrrrr} \hline & Estimate & Std. Error & z value & Pr($>$$|$z$|$) \\ \hline (Intercept) & 3.1888 & 1.5966 & 2.00 & 0.0458 \\ ethnictyHISPANIC & -0.2848 & 2.4808 & -0.11 & 0.9086 \\ ethnictyOTHER & 212.1701 & 22122.7093 & 0.01 & 0.9923 \\ ethnictyWHITE & -8.8150 & 3.3355 & -2.64 & 0.0082 \\ grade & -0.5308 & 0.2892 & -1.84 & 0.0665 \\ ethnictyHISPANIC:grade & 0.2448 & 0.4357 & 0.56 & 0.5742 \\ ethnictyOTHER:grade & -32.6014 & 3393.4687 & -0.01 & 0.9923 \\ ethnictyWHITE:grade & 1.0171 & 0.5185 & 1.96 & 0.0498 \\ \hline \end{tabular} \end{table} > print(fm3.table, type = "html")
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.1888 1.5966 2.00 0.0458
ethnictyHISPANIC -0.2848 2.4808 -0.11 0.9086
ethnictyOTHER 212.1701 22122.7093 0.01 0.9923
ethnictyWHITE -8.8150 3.3355 -2.64 0.0082
grade -0.5308 0.2892 -1.84 0.0665
ethnictyHISPANIC:grade 0.2448 0.4357 0.56 0.5742
ethnictyOTHER:grade -32.6014 3393.4687 -0.01 0.9923
ethnictyWHITE:grade 1.0171 0.5185 1.96 0.0498
> print(xtable(anova(fm3))) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrr} \hline & Df & Deviance & Resid. Df & Resid. Dev \\ \hline NULL & & & 99 & 129.49 \\ ethnicty & 3 & 47.24 & 96 & 82.25 \\ grade & 1 & 1.73 & 95 & 80.52 \\ ethnicty:grade & 3 & 7.20 & 92 & 73.32 \\ \hline \end{tabular} \end{table} > print(xtable(anova(fm3)), type = "html")
Df Deviance Resid. Df Resid. Dev
NULL 99 129.49
ethnicty 3 47.24 96 82.25
grade 1 1.73 95 80.52
ethnicty:grade 3 7.20 92 73.32
> > ## Demonstrate aov > ## Taken from help(aov) in R 1.1.1 > ## From Venables and Ripley (1997) p.210. > N <- c(0,1,0,1,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,0) > P <- c(1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0) > K <- c(1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0) > yield <- c(49.5,62.8,46.8,57.0,59.8,58.5,55.5,56.0,62.8,55.8,69.5,55.0, + 62.0,48.8,45.5,44.2,52.0,51.5,49.8,48.8,57.2,59.0,53.2,56.0) > npk <- data.frame(block = gl(6,4), N = factor(N), P = factor(P), + K = factor(K), yield = yield) > npk.aov <- aov(yield ~ block + N*P*K, npk) > op <- options(contrasts = c("contr.helmert", "contr.treatment")) > npk.aovE <- aov(yield ~ N*P*K + Error(block), npk) > options(op) > > summary(npk.aov) Df Sum Sq Mean Sq F value Pr(>F) block 5 343.3 68.66 4.447 0.01594 * N 1 189.3 189.28 12.259 0.00437 ** P 1 8.4 8.40 0.544 0.47490 K 1 95.2 95.20 6.166 0.02880 * N:P 1 21.3 21.28 1.378 0.26317 N:K 1 33.1 33.13 2.146 0.16865 P:K 1 0.5 0.48 0.031 0.86275 Residuals 12 185.3 15.44 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > print(xtable(npk.aov)) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrr} \hline & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ \hline block & 5 & 343.29 & 68.66 & 4.45 & 0.0159 \\ N & 1 & 189.28 & 189.28 & 12.26 & 0.0044 \\ P & 1 & 8.40 & 8.40 & 0.54 & 0.4749 \\ K & 1 & 95.20 & 95.20 & 6.17 & 0.0288 \\ N:P & 1 & 21.28 & 21.28 & 1.38 & 0.2632 \\ N:K & 1 & 33.13 & 33.13 & 2.15 & 0.1686 \\ P:K & 1 & 0.48 & 0.48 & 0.03 & 0.8628 \\ Residuals & 12 & 185.29 & 15.44 & & \\ \hline \end{tabular} \end{table} > print(xtable(anova(npk.aov))) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrr} \hline & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ \hline block & 5 & 343.29 & 68.66 & 4.45 & 0.0159 \\ N & 1 & 189.28 & 189.28 & 12.26 & 0.0044 \\ P & 1 & 8.40 & 8.40 & 0.54 & 0.4749 \\ K & 1 & 95.20 & 95.20 & 6.17 & 0.0288 \\ N:P & 1 & 21.28 & 21.28 & 1.38 & 0.2632 \\ N:K & 1 & 33.13 & 33.13 & 2.15 & 0.1686 \\ P:K & 1 & 0.48 & 0.48 & 0.03 & 0.8628 \\ Residuals & 12 & 185.29 & 15.44 & & \\ \hline \end{tabular} \end{table} > print(xtable(summary(npk.aov))) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrr} \hline & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ \hline block & 5 & 343.29 & 68.66 & 4.45 & 0.0159 \\ N & 1 & 189.28 & 189.28 & 12.26 & 0.0044 \\ P & 1 & 8.40 & 8.40 & 0.54 & 0.4749 \\ K & 1 & 95.20 & 95.20 & 6.17 & 0.0288 \\ N:P & 1 & 21.28 & 21.28 & 1.38 & 0.2632 \\ N:K & 1 & 33.13 & 33.13 & 2.15 & 0.1686 \\ P:K & 1 & 0.48 & 0.48 & 0.03 & 0.8628 \\ Residuals & 12 & 185.29 & 15.44 & & \\ \hline \end{tabular} \end{table} > > summary(npk.aovE) Error: block Df Sum Sq Mean Sq F value Pr(>F) N:P:K 1 37.0 37.00 0.483 0.525 Residuals 4 306.3 76.57 Error: Within Df Sum Sq Mean Sq F value Pr(>F) N 1 189.28 189.28 12.259 0.00437 ** P 1 8.40 8.40 0.544 0.47490 K 1 95.20 95.20 6.166 0.02880 * N:P 1 21.28 21.28 1.378 0.26317 N:K 1 33.14 33.14 2.146 0.16865 P:K 1 0.48 0.48 0.031 0.86275 Residuals 12 185.29 15.44 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > print(xtable(npk.aovE), type = "html")
Df Sum Sq Mean Sq F value Pr(>F)
N:P:K 1 37.00 37.00 0.48 0.5252
Residuals 4 306.29 76.57
N 1 189.28 189.28 12.26 0.0044
P 1 8.40 8.40 0.54 0.4749
K 1 95.20 95.20 6.17 0.0288
N:P 1 21.28 21.28 1.38 0.2632
N:K 1 33.14 33.14 2.15 0.1686
P:K 1 0.48 0.48 0.03 0.8628
Residuals1 12 185.29 15.44
> print(xtable(summary(npk.aovE)), type = "html")
Df Sum Sq Mean Sq F value Pr(>F)
N:P:K 1 37.00 37.00 0.48 0.5252
Residuals 4 306.29 76.57
N 1 189.28 189.28 12.26 0.0044
P 1 8.40 8.40 0.54 0.4749
K 1 95.20 95.20 6.17 0.0288
N:P 1 21.28 21.28 1.38 0.2632
N:K 1 33.14 33.14 2.15 0.1686
P:K 1 0.48 0.48 0.03 0.8628
Residuals1 12 185.29 15.44
> > ## Demonstrate lm > ## Taken from help(lm) in R 1.1.1 > ## Annette Dobson (1990) "An Introduction to Generalized Linear Models". > ## Page 9: Plant Weight Data. > ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) > trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) > group <- gl(2,10,20, labels = c("Ctl","Trt")) > weight <- c(ctl, trt) > lm.D9 <- lm(weight ~ group) > print(xtable(lm.D9)) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{rrrrr} \hline & Estimate & Std. Error & t value & Pr($>$$|$t$|$) \\ \hline (Intercept) & 5.0320 & 0.2202 & 22.85 & 0.0000 \\ groupTrt & -0.3710 & 0.3114 & -1.19 & 0.2490 \\ \hline \end{tabular} \end{table} > print(xtable(anova(lm.D9))) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrr} \hline & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ \hline group & 1 & 0.69 & 0.69 & 1.42 & 0.2490 \\ Residuals & 18 & 8.73 & 0.48 & & \\ \hline \end{tabular} \end{table} > > ## Demonstrate glm > ## Taken from help(glm) in R 1.1.1 > ## Annette Dobson (1990) "An Introduction to Generalized Linear Models". > ## Page 93: Randomized Controlled Trial : > counts <- c(18,17,15,20,10,20,25,13,12) > outcome <- gl(3,1,9) > treatment <- gl(3,3) > d.AD <- data.frame(treatment, outcome, counts) > glm.D93 <- glm(counts ~ outcome + treatment, family = poisson()) > print(xtable(glm.D93, align = "r|llrc")) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{r|llrc} \hline & Estimate & Std. Error & z value & Pr($>$$|$z$|$) \\ \hline (Intercept) & 3.0445 & 0.1709 & 17.81 & 0.0000 \\ outcome2 & -0.4543 & 0.2022 & -2.25 & 0.0246 \\ outcome3 & -0.2930 & 0.1927 & -1.52 & 0.1285 \\ treatment2 & 0.0000 & 0.2000 & 0.00 & 1.0000 \\ treatment3 & 0.0000 & 0.2000 & 0.00 & 1.0000 \\ \hline \end{tabular} \end{table} > print(xtable(anova(glm.D93)), hline.after = c(1), size = "small") % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering {\small \begin{tabular}{lrrrr} & Df & Deviance & Resid. Df & Resid. Dev \\ NULL & & & 8 & 10.58 \\ \hline outcome & 2 & 5.45 & 6 & 5.13 \\ treatment & 2 & 0.00 & 4 & 5.13 \\ \end{tabular} } \end{table} > > ## Demonstration of additional formatC() arguments. > print(fm1.table, format.args = list(big.mark = "'", decimal.mark = ",")) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrr} \hline & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ \hline sex & 1 & 75,37 & 75,37 & 0,38 & 0,5417 \\ ethnicty & 3 & 2'572,15 & 857,38 & 4,27 & 0,0072 \\ grade & 1 & 36,31 & 36,31 & 0,18 & 0,6717 \\ disadvg & 1 & 59,30 & 59,30 & 0,30 & 0,5882 \\ Residuals & 93 & 18'682,87 & 200,89 & & \\ \hline \end{tabular} \end{table} > > ## Demonstration of "short caption" support. > fm1sc <- aov(tlimth ~ sex + ethnicty + grade, data = tli) > fm1sc.table <- xtable(fm1sc, + caption = c("ANOVA Model with Predictors Sex, Ethnicity, and Grade", + "ANOVA: Sex, Ethnicity, Grade")) > print(fm1sc.table) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{lrrrrr} \hline & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ \hline sex & 1 & 75.37 & 75.37 & 0.38 & 0.5401 \\ ethnicty & 3 & 2572.15 & 857.38 & 4.30 & 0.0069 \\ grade & 1 & 36.31 & 36.31 & 0.18 & 0.6706 \\ Residuals & 94 & 18742.17 & 199.38 & & \\ \hline \end{tabular} \caption[ANOVA: Sex, Ethnicity, Grade]{ANOVA Model with Predictors Sex, Ethnicity, and Grade} \end{table} > > ## Demonstration of longtable support. > ## Remember to insert \usepackage{longtable} on your LaTeX preamble > x <- matrix(rnorm(1000), ncol = 10) > x.big <- xtable(x, label = 'tabbig', + caption = 'Example of longtable spanning several pages') > print(x.big, tabular.environment = 'longtable', floating = FALSE) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{longtable}{rrrrrrrrrrr} \hline & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline 1 & 2.35 & -1.12 & -0.94 & 0.91 & -1.15 & -1.36 & -1.08 & -0.45 & 0.54 & -1.52 \\ 2 & -0.42 & -0.13 & -2.13 & 0.17 & -0.84 & -2.36 & -1.64 & 0.54 & -0.95 & -0.45 \\ 3 & -0.11 & -0.16 & -0.51 & -0.60 & 0.04 & -0.04 & 0.01 & -0.78 & -1.46 & 0.46 \\ 4 & -1.24 & -1.44 & 1.26 & -1.53 & 0.80 & 2.20 & 0.34 & -0.26 & 1.02 & -0.87 \\ 5 & -0.14 & -0.23 & -0.76 & 0.85 & 0.37 & 1.47 & 0.52 & 0.25 & 0.34 & 1.40 \\ 6 & -0.19 & -0.97 & 1.77 & 1.17 & -0.16 & 0.28 & -2.06 & 1.21 & 0.24 & -0.00 \\ 7 & -0.77 & -1.05 & -0.54 & 1.07 & -0.07 & -0.07 & 1.54 & -1.85 & -0.62 & 1.14 \\ 8 & 0.78 & 0.25 & 0.90 & -0.51 & 1.15 & -0.73 & 0.10 & 1.00 & -1.01 & 1.68 \\ 9 & -2.16 & -0.21 & -0.37 & 0.65 & -0.36 & 0.00 & 0.51 & -0.05 & -1.31 & 1.22 \\ 10 & -0.02 & -1.74 & -0.19 & -0.57 & -1.05 & -1.36 & -0.63 & 0.84 & -1.15 & 1.14 \\ 11 & -1.61 & 1.45 & -1.44 & -0.56 & -1.76 & -0.40 & 0.61 & 0.53 & -1.43 & 0.65 \\ 12 & -2.15 & -1.48 & -0.54 & -1.75 & -0.42 & -0.06 & 0.27 & 1.06 & 1.37 & 0.55 \\ 13 & 0.17 & 0.22 & 0.43 & 0.33 & 1.51 & 0.43 & -0.29 & 1.08 & -0.79 & -0.45 \\ 14 & 1.18 & -0.95 & 0.93 & 0.48 & -0.73 & -1.37 & 1.11 & 1.09 & -2.98 & 0.02 \\ 15 & 0.45 & -0.15 & 0.74 & 0.29 & -1.00 & 0.50 & -1.46 & -0.28 & 2.05 & -1.40 \\ 16 & -0.35 & 1.29 & -0.43 & -0.34 & -0.80 & -0.21 & -0.63 & -0.12 & 0.50 & 0.51 \\ 17 & 0.37 & 0.17 & 1.10 & -1.00 & -1.44 & 0.00 & -0.35 & 1.74 & 0.32 & 0.68 \\ 18 & 0.60 & -0.19 & -1.09 & 0.51 & -0.01 & 1.14 & 0.77 & -0.98 & 0.39 & 0.00 \\ 19 & 0.60 & 0.30 & -1.04 & -0.91 & -0.11 & -1.39 & 1.67 & -0.17 & -0.26 & 2.18 \\ 20 & 1.87 & -0.34 & 0.05 & -0.93 & 0.02 & 0.88 & -0.19 & -0.87 & -1.06 & -1.21 \\ 21 & -1.15 & -0.07 & 0.62 & 1.46 & -0.06 & -0.66 & -0.35 & 0.72 & 1.14 & 0.44 \\ 22 & 0.70 & 0.24 & 0.81 & 0.35 & -0.48 & 0.08 & -1.22 & -0.04 & 0.99 & 0.86 \\ 23 & 0.55 & -0.29 & -0.16 & -0.06 & -0.90 & -0.07 & -1.63 & 1.06 & 0.26 & 0.81 \\ 24 & -0.81 & -1.30 & -0.26 & -2.00 & -0.38 & -1.07 & -0.56 & -0.03 & -2.07 & -0.15 \\ 25 & -0.66 & -1.87 & -0.81 & 1.34 & -0.47 & 0.44 & 1.19 & -0.23 & -1.16 & -1.25 \\ 26 & 0.69 & 1.16 & 0.62 & -0.56 & 0.09 & -0.19 & 0.18 & -0.14 & 0.47 & 0.36 \\ 27 & 0.02 & -0.81 & 1.48 & 1.05 & -0.39 & -0.60 & -2.54 & 0.44 & -0.01 & 0.21 \\ 28 & 0.03 & 0.51 & 0.90 & -0.46 & -0.88 & 0.27 & 0.83 & 0.13 & -1.77 & -0.30 \\ 29 & -1.01 & -0.34 & -0.08 & 1.50 & -1.08 & -0.28 & 0.29 & 0.92 & 0.24 & 1.20 \\ 30 & -0.32 & 0.06 & -0.29 & -1.92 & -0.74 & 0.33 & 1.18 & 0.33 & 0.36 & -0.70 \\ 31 & -0.92 & -0.83 & -0.00 & 1.66 & -1.81 & 0.56 & 0.84 & -0.82 & 0.31 & -1.00 \\ 32 & -0.50 & 0.19 & -0.40 & 0.35 & 1.18 & -0.23 & -0.41 & -0.18 & -1.10 & -1.61 \\ 33 & 0.69 & -0.06 & 0.09 & -0.64 & -1.87 & -0.26 & 0.27 & 0.61 & -0.59 & 1.90 \\ 34 & 1.43 & -0.80 & -0.50 & -1.59 & 1.20 & -0.45 & -1.31 & -0.74 & -0.58 & -0.38 \\ 35 & -0.53 & 1.03 & 1.25 & -0.69 & 1.20 & 0.92 & 0.55 & -2.30 & -1.64 & 0.47 \\ 36 & 0.19 & -0.58 & -0.23 & 1.50 & -0.07 & 0.13 & 0.57 & -0.00 & -1.73 & -0.56 \\ 37 & 0.16 & 0.28 & 0.31 & -1.32 & 1.48 & 0.38 & 1.82 & 0.06 & 1.44 & -0.73 \\ 38 & -0.23 & -0.54 & -0.35 & 0.62 & 0.09 & 2.26 & -1.41 & -0.32 & -1.33 & -0.41 \\ 39 & -0.45 & -1.57 & -0.44 & -1.10 & 0.29 & -0.00 & 1.04 & 0.07 & 1.20 & 0.28 \\ 40 & -0.96 & -0.24 & 0.57 & 1.43 & -0.16 & 0.55 & 0.35 & 1.45 & -0.92 & 0.28 \\ 41 & -1.76 & 0.03 & 0.27 & 0.42 & 0.67 & 0.81 & 0.50 & -0.91 & -0.14 & 0.26 \\ 42 & -0.33 & 0.61 & -0.78 & -0.70 & -0.27 & -0.20 & -0.79 & -0.30 & -1.50 & 0.74 \\ 43 & -0.49 & -0.94 & -0.38 & -1.03 & -0.90 & -0.33 & -0.35 & -0.18 & -0.10 & -0.19 \\ 44 & -0.19 & -1.33 & -0.29 & -0.99 & -1.19 & 0.13 & -0.79 & -0.04 & -0.74 & 0.31 \\ 45 & -0.77 & -0.36 & -0.43 & 1.25 & -0.81 & -0.51 & -0.80 & -0.37 & 0.27 & 0.48 \\ 46 & -2.52 & 1.90 & 0.72 & -1.50 & -1.68 & -0.29 & 0.71 & -0.25 & 0.20 & 0.55 \\ 47 & 1.50 & -1.87 & -0.45 & -0.48 & 0.20 & -0.71 & 0.28 & -0.76 & 1.02 & -0.63 \\ 48 & 0.65 & -0.79 & 0.77 & -0.63 & 1.24 & 1.23 & 1.00 & -0.60 & -0.95 & -1.06 \\ 49 & -0.67 & 0.63 & 0.69 & -1.34 & -0.79 & 0.18 & -1.97 & 2.51 & -1.17 & 1.06 \\ 50 & -0.61 & -0.18 & -0.69 & 0.08 & -1.60 & 0.61 & 1.13 & 0.64 & -0.39 & -1.11 \\ 51 & -0.49 & 0.88 & 1.51 & 0.26 & -0.10 & 0.71 & -1.73 & -1.41 & 0.16 & -0.39 \\ 52 & -0.24 & 1.15 & 0.18 & -0.34 & -0.26 & 0.89 & -1.89 & 0.29 & 0.73 & 0.03 \\ 53 & 0.94 & -0.17 & 1.06 & -0.97 & -0.34 & -0.12 & -0.29 & -0.67 & 2.23 & -0.75 \\ 54 & 0.42 & 0.41 & 0.53 & 1.95 & 0.22 & 0.55 & 0.14 & 0.43 & -0.74 & -0.43 \\ 55 & -0.06 & -2.17 & -0.98 & 2.31 & 0.77 & -0.27 & 0.55 & -0.07 & 0.10 & -2.12 \\ 56 & 1.61 & 0.02 & -0.98 & 0.84 & 0.69 & 0.67 & -0.96 & -1.57 & -2.53 & 2.58 \\ 57 & 0.70 & -0.93 & -0.72 & -0.25 & -0.07 & -0.02 & -0.57 & -0.70 & -0.17 & 0.69 \\ 58 & 1.29 & 0.04 & -1.05 & 1.61 & 0.28 & -1.07 & 0.06 & -0.62 & 0.77 & -1.90 \\ 59 & 0.21 & -1.74 & -1.94 & -3.15 & -0.44 & 1.44 & 0.49 & -0.55 & -0.74 & -1.79 \\ 60 & 0.84 & -1.23 & 2.25 & -1.13 & -1.25 & -1.00 & -0.90 & 0.94 & -1.29 & -1.06 \\ 61 & -0.10 & 0.19 & 0.01 & -1.32 & 0.70 & 0.04 & 1.29 & 0.37 & -0.66 & -0.80 \\ 62 & -1.76 & 1.41 & 1.02 & -0.99 & 0.39 & -0.50 & -1.06 & -1.21 & -1.10 & 0.81 \\ 63 & -0.32 & -0.41 & 0.04 & 0.19 & -0.23 & 1.59 & 0.66 & 1.18 & -1.36 & 0.64 \\ 64 & 1.09 & -0.31 & -0.07 & -0.83 & 0.49 & 0.20 & -0.27 & -1.71 & 0.55 & -1.07 \\ 65 & -0.33 & 1.69 & 1.16 & 1.44 & 0.31 & 0.44 & -1.21 & -0.13 & -0.17 & -0.19 \\ 66 & -0.47 & -0.29 & -1.29 & 0.66 & 0.88 & 0.25 & -1.49 & -2.17 & -0.27 & 0.81 \\ 67 & -0.85 & -0.06 & 0.12 & -1.21 & -0.45 & -1.33 & 0.09 & -1.31 & -0.27 & -0.53 \\ 68 & 2.60 & 1.08 & -2.03 & 2.17 & -0.75 & 0.99 & -0.52 & 1.41 & -0.94 & 0.84 \\ 69 & 0.73 & 1.70 & 0.58 & -0.57 & -0.87 & -0.71 & -0.10 & -1.94 & -1.74 & 1.18 \\ 70 & 0.51 & 1.53 & 0.58 & 0.73 & 1.44 & -0.68 & -0.86 & 0.34 & -0.52 & -0.04 \\ 71 & -0.15 & 0.12 & -1.09 & 1.17 & -0.15 & 1.26 & 0.34 & -1.80 & 1.00 & 1.04 \\ 72 & 0.06 & -0.03 & 1.61 & -0.72 & 0.01 & -0.69 & 0.79 & 0.43 & 1.16 & -0.23 \\ 73 & 0.28 & 0.82 & 0.31 & 0.31 & 0.16 & -0.68 & 1.15 & -0.15 & 0.63 & -0.01 \\ 74 & -0.71 & 0.12 & -0.97 & 1.47 & -0.12 & 1.67 & -0.15 & -0.31 & 0.81 & -1.47 \\ 75 & 0.49 & -0.31 & 0.26 & -1.25 & 1.68 & 1.00 & 1.09 & 0.43 & -0.48 & -0.16 \\ 76 & 1.13 & 1.54 & -0.70 & 0.63 & -1.57 & -0.12 & 1.27 & 0.67 & 0.54 & 0.43 \\ 77 & -0.09 & 0.66 & 0.44 & 1.19 & 0.47 & 0.99 & -0.35 & 1.12 & -0.03 & -2.05 \\ 78 & 0.70 & 0.46 & -1.83 & 0.63 & 1.75 & -2.27 & -1.50 & 1.28 & -0.71 & 1.86 \\ 79 & 0.03 & -1.24 & 1.27 & 0.12 & -0.86 & -0.14 & -0.30 & 0.97 & 0.59 & 1.40 \\ 80 & -0.98 & -1.86 & -0.36 & 0.30 & 1.45 & -1.53 & -1.19 & -0.86 & -2.58 & 0.16 \\ 81 & 0.05 & 1.43 & 1.35 & -0.35 & -0.08 & -0.57 & -1.77 & -1.08 & 1.92 & -0.75 \\ 82 & 1.11 & -0.83 & -0.80 & -1.21 & -0.40 & -1.05 & -1.31 & -0.31 & 0.66 & -0.47 \\ 83 & 1.12 & -0.42 & -0.26 & 0.97 & -0.36 & -2.71 & -0.40 & 0.32 & 1.61 & -1.14 \\ 84 & 0.26 & -1.12 & -0.42 & -0.72 & -0.81 & -0.46 & 0.58 & 0.56 & 2.27 & -0.86 \\ 85 & 0.56 & -0.44 & 0.57 & -0.15 & 0.86 & -1.02 & 1.37 & -0.81 & 1.79 & -1.41 \\ 86 & 1.14 & -0.53 & -1.39 & 1.31 & 0.09 & -2.30 & -0.86 & -2.09 & 0.75 & 0.03 \\ 87 & -0.34 & -1.24 & 0.20 & -1.23 & -0.09 & 1.51 & 1.03 & 1.29 & -0.85 & 0.33 \\ 88 & -0.60 & -0.75 & -0.57 & 0.77 & 0.76 & -0.68 & -0.69 & -0.71 & -0.06 & -0.28 \\ 89 & -0.21 & -1.19 & 0.47 & -0.82 & 0.41 & 0.83 & -0.99 & 1.25 & -1.29 & 0.75 \\ 90 & -1.96 & 1.53 & -0.08 & 1.09 & 1.05 & 0.43 & 0.51 & 0.95 & 0.35 & 0.97 \\ 91 & 1.31 & 1.06 & -0.31 & 1.02 & 0.49 & 0.74 & 0.87 & -1.09 & -1.06 & 0.66 \\ 92 & 0.31 & -1.57 & 1.17 & -0.47 & -1.62 & -0.40 & 0.40 & 0.61 & -0.75 & 0.56 \\ 93 & -0.70 & -0.41 & 1.01 & 0.63 & 0.15 & -0.16 & 0.40 & -0.48 & 2.97 & 0.06 \\ 94 & 1.26 & -1.96 & -0.28 & -0.90 & -1.61 & -0.09 & 0.05 & -1.84 & -0.60 & 0.10 \\ 95 & -1.21 & 0.43 & -0.44 & -0.38 & 1.28 & 0.69 & -0.82 & -0.24 & -0.52 & -1.48 \\ 96 & 1.02 & -0.77 & 0.71 & 1.39 & -1.08 & -0.39 & 0.82 & 0.89 & 1.64 & 1.48 \\ 97 & -0.09 & 1.28 & 1.29 & 0.49 & 0.53 & -0.98 & -1.68 & 0.34 & 0.53 & -1.63 \\ 98 & -0.55 & 2.33 & 1.67 & -0.30 & 1.32 & -0.02 & 0.96 & 0.56 & 2.66 & 0.61 \\ 99 & 0.35 & 0.09 & -2.47 & -0.86 & -0.12 & -0.15 & -1.34 & 0.47 & 0.36 & 0.93 \\ 100 & 1.01 & 2.25 & 0.94 & 0.82 & -0.01 & -0.74 & 0.90 & 0.40 & 0.70 & 0.80 \\ \hline \hline \caption{Example of longtable spanning several pages} \label{tabbig} \end{longtable} > x <- x[1:30, ] > x.small <- xtable(x, label = 'tabsmall', caption = 'regular table env') > print(x.small) # default, no longtable % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{rrrrrrrrrrr} \hline & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline 1 & 2.35 & -1.12 & -0.94 & 0.91 & -1.15 & -1.36 & -1.08 & -0.45 & 0.54 & -1.52 \\ 2 & -0.42 & -0.13 & -2.13 & 0.17 & -0.84 & -2.36 & -1.64 & 0.54 & -0.95 & -0.45 \\ 3 & -0.11 & -0.16 & -0.51 & -0.60 & 0.04 & -0.04 & 0.01 & -0.78 & -1.46 & 0.46 \\ 4 & -1.24 & -1.44 & 1.26 & -1.53 & 0.80 & 2.20 & 0.34 & -0.26 & 1.02 & -0.87 \\ 5 & -0.14 & -0.23 & -0.76 & 0.85 & 0.37 & 1.47 & 0.52 & 0.25 & 0.34 & 1.40 \\ 6 & -0.19 & -0.97 & 1.77 & 1.17 & -0.16 & 0.28 & -2.06 & 1.21 & 0.24 & -0.00 \\ 7 & -0.77 & -1.05 & -0.54 & 1.07 & -0.07 & -0.07 & 1.54 & -1.85 & -0.62 & 1.14 \\ 8 & 0.78 & 0.25 & 0.90 & -0.51 & 1.15 & -0.73 & 0.10 & 1.00 & -1.01 & 1.68 \\ 9 & -2.16 & -0.21 & -0.37 & 0.65 & -0.36 & 0.00 & 0.51 & -0.05 & -1.31 & 1.22 \\ 10 & -0.02 & -1.74 & -0.19 & -0.57 & -1.05 & -1.36 & -0.63 & 0.84 & -1.15 & 1.14 \\ 11 & -1.61 & 1.45 & -1.44 & -0.56 & -1.76 & -0.40 & 0.61 & 0.53 & -1.43 & 0.65 \\ 12 & -2.15 & -1.48 & -0.54 & -1.75 & -0.42 & -0.06 & 0.27 & 1.06 & 1.37 & 0.55 \\ 13 & 0.17 & 0.22 & 0.43 & 0.33 & 1.51 & 0.43 & -0.29 & 1.08 & -0.79 & -0.45 \\ 14 & 1.18 & -0.95 & 0.93 & 0.48 & -0.73 & -1.37 & 1.11 & 1.09 & -2.98 & 0.02 \\ 15 & 0.45 & -0.15 & 0.74 & 0.29 & -1.00 & 0.50 & -1.46 & -0.28 & 2.05 & -1.40 \\ 16 & -0.35 & 1.29 & -0.43 & -0.34 & -0.80 & -0.21 & -0.63 & -0.12 & 0.50 & 0.51 \\ 17 & 0.37 & 0.17 & 1.10 & -1.00 & -1.44 & 0.00 & -0.35 & 1.74 & 0.32 & 0.68 \\ 18 & 0.60 & -0.19 & -1.09 & 0.51 & -0.01 & 1.14 & 0.77 & -0.98 & 0.39 & 0.00 \\ 19 & 0.60 & 0.30 & -1.04 & -0.91 & -0.11 & -1.39 & 1.67 & -0.17 & -0.26 & 2.18 \\ 20 & 1.87 & -0.34 & 0.05 & -0.93 & 0.02 & 0.88 & -0.19 & -0.87 & -1.06 & -1.21 \\ 21 & -1.15 & -0.07 & 0.62 & 1.46 & -0.06 & -0.66 & -0.35 & 0.72 & 1.14 & 0.44 \\ 22 & 0.70 & 0.24 & 0.81 & 0.35 & -0.48 & 0.08 & -1.22 & -0.04 & 0.99 & 0.86 \\ 23 & 0.55 & -0.29 & -0.16 & -0.06 & -0.90 & -0.07 & -1.63 & 1.06 & 0.26 & 0.81 \\ 24 & -0.81 & -1.30 & -0.26 & -2.00 & -0.38 & -1.07 & -0.56 & -0.03 & -2.07 & -0.15 \\ 25 & -0.66 & -1.87 & -0.81 & 1.34 & -0.47 & 0.44 & 1.19 & -0.23 & -1.16 & -1.25 \\ 26 & 0.69 & 1.16 & 0.62 & -0.56 & 0.09 & -0.19 & 0.18 & -0.14 & 0.47 & 0.36 \\ 27 & 0.02 & -0.81 & 1.48 & 1.05 & -0.39 & -0.60 & -2.54 & 0.44 & -0.01 & 0.21 \\ 28 & 0.03 & 0.51 & 0.90 & -0.46 & -0.88 & 0.27 & 0.83 & 0.13 & -1.77 & -0.30 \\ 29 & -1.01 & -0.34 & -0.08 & 1.50 & -1.08 & -0.28 & 0.29 & 0.92 & 0.24 & 1.20 \\ 30 & -0.32 & 0.06 & -0.29 & -1.92 & -0.74 & 0.33 & 1.18 & 0.33 & 0.36 & -0.70 \\ \hline \end{tabular} \caption{regular table env} \label{tabsmall} \end{table} > > ## Demonstration of sidewaystable support. > ## Remember to insert \usepackage{rotating} on your LaTeX preamble > print(x.small, floating.environment = 'sidewaystable') % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{sidewaystable}[ht] \centering \begin{tabular}{rrrrrrrrrrr} \hline & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline 1 & 2.35 & -1.12 & -0.94 & 0.91 & -1.15 & -1.36 & -1.08 & -0.45 & 0.54 & -1.52 \\ 2 & -0.42 & -0.13 & -2.13 & 0.17 & -0.84 & -2.36 & -1.64 & 0.54 & -0.95 & -0.45 \\ 3 & -0.11 & -0.16 & -0.51 & -0.60 & 0.04 & -0.04 & 0.01 & -0.78 & -1.46 & 0.46 \\ 4 & -1.24 & -1.44 & 1.26 & -1.53 & 0.80 & 2.20 & 0.34 & -0.26 & 1.02 & -0.87 \\ 5 & -0.14 & -0.23 & -0.76 & 0.85 & 0.37 & 1.47 & 0.52 & 0.25 & 0.34 & 1.40 \\ 6 & -0.19 & -0.97 & 1.77 & 1.17 & -0.16 & 0.28 & -2.06 & 1.21 & 0.24 & -0.00 \\ 7 & -0.77 & -1.05 & -0.54 & 1.07 & -0.07 & -0.07 & 1.54 & -1.85 & -0.62 & 1.14 \\ 8 & 0.78 & 0.25 & 0.90 & -0.51 & 1.15 & -0.73 & 0.10 & 1.00 & -1.01 & 1.68 \\ 9 & -2.16 & -0.21 & -0.37 & 0.65 & -0.36 & 0.00 & 0.51 & -0.05 & -1.31 & 1.22 \\ 10 & -0.02 & -1.74 & -0.19 & -0.57 & -1.05 & -1.36 & -0.63 & 0.84 & -1.15 & 1.14 \\ 11 & -1.61 & 1.45 & -1.44 & -0.56 & -1.76 & -0.40 & 0.61 & 0.53 & -1.43 & 0.65 \\ 12 & -2.15 & -1.48 & -0.54 & -1.75 & -0.42 & -0.06 & 0.27 & 1.06 & 1.37 & 0.55 \\ 13 & 0.17 & 0.22 & 0.43 & 0.33 & 1.51 & 0.43 & -0.29 & 1.08 & -0.79 & -0.45 \\ 14 & 1.18 & -0.95 & 0.93 & 0.48 & -0.73 & -1.37 & 1.11 & 1.09 & -2.98 & 0.02 \\ 15 & 0.45 & -0.15 & 0.74 & 0.29 & -1.00 & 0.50 & -1.46 & -0.28 & 2.05 & -1.40 \\ 16 & -0.35 & 1.29 & -0.43 & -0.34 & -0.80 & -0.21 & -0.63 & -0.12 & 0.50 & 0.51 \\ 17 & 0.37 & 0.17 & 1.10 & -1.00 & -1.44 & 0.00 & -0.35 & 1.74 & 0.32 & 0.68 \\ 18 & 0.60 & -0.19 & -1.09 & 0.51 & -0.01 & 1.14 & 0.77 & -0.98 & 0.39 & 0.00 \\ 19 & 0.60 & 0.30 & -1.04 & -0.91 & -0.11 & -1.39 & 1.67 & -0.17 & -0.26 & 2.18 \\ 20 & 1.87 & -0.34 & 0.05 & -0.93 & 0.02 & 0.88 & -0.19 & -0.87 & -1.06 & -1.21 \\ 21 & -1.15 & -0.07 & 0.62 & 1.46 & -0.06 & -0.66 & -0.35 & 0.72 & 1.14 & 0.44 \\ 22 & 0.70 & 0.24 & 0.81 & 0.35 & -0.48 & 0.08 & -1.22 & -0.04 & 0.99 & 0.86 \\ 23 & 0.55 & -0.29 & -0.16 & -0.06 & -0.90 & -0.07 & -1.63 & 1.06 & 0.26 & 0.81 \\ 24 & -0.81 & -1.30 & -0.26 & -2.00 & -0.38 & -1.07 & -0.56 & -0.03 & -2.07 & -0.15 \\ 25 & -0.66 & -1.87 & -0.81 & 1.34 & -0.47 & 0.44 & 1.19 & -0.23 & -1.16 & -1.25 \\ 26 & 0.69 & 1.16 & 0.62 & -0.56 & 0.09 & -0.19 & 0.18 & -0.14 & 0.47 & 0.36 \\ 27 & 0.02 & -0.81 & 1.48 & 1.05 & -0.39 & -0.60 & -2.54 & 0.44 & -0.01 & 0.21 \\ 28 & 0.03 & 0.51 & 0.90 & -0.46 & -0.88 & 0.27 & 0.83 & 0.13 & -1.77 & -0.30 \\ 29 & -1.01 & -0.34 & -0.08 & 1.50 & -1.08 & -0.28 & 0.29 & 0.92 & 0.24 & 1.20 \\ 30 & -0.32 & 0.06 & -0.29 & -1.92 & -0.74 & 0.33 & 1.18 & 0.33 & 0.36 & -0.70 \\ \hline \end{tabular} \caption{regular table env} \label{tabsmall} \end{sidewaystable} > > if(require(stats, quietly = TRUE)) { + ## Demonstrate prcomp + ## Taken from help(prcomp) in mva package of R 1.1.1 + data(USArrests) + pr1 <- prcomp(USArrests) + print(xtable(pr1)) + print(xtable(summary(pr1))) + + # ## Demonstrate princomp + # ## Taken from help(princomp) in mva package of R 1.1.1 + # pr2 <- princomp(USArrests) + # print(xtable(pr2)) + } % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{rrrrr} \hline & PC1 & PC2 & PC3 & PC4 \\ \hline Murder & 0.0417 & -0.0448 & 0.0799 & -0.9949 \\ Assault & 0.9952 & -0.0588 & -0.0676 & 0.0389 \\ UrbanPop & 0.0463 & 0.9769 & -0.2005 & -0.0582 \\ Rape & 0.0752 & 0.2007 & 0.9741 & 0.0723 \\ \hline \end{tabular} \end{table} % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 \begin{table}[ht] \centering \begin{tabular}{rrrrr} \hline & PC1 & PC2 & PC3 & PC4 \\ \hline Standard deviation & 83.7324 & 14.2124 & 6.4894 & 2.4828 \\ Proportion of Variance & 0.9655 & 0.0278 & 0.0058 & 0.0008 \\ Cumulative Proportion & 0.9655 & 0.9933 & 0.9991 & 1.0000 \\ \hline \end{tabular} \end{table} > > ## Demonstrate include.rownames, include.colnames, > ## only.contents and add.to.row arguments > set.seed(2345) > res <- matrix(sample(0:9, size = 6*9, replace = TRUE), ncol = 6, nrow = 9) > xres <- xtable(res) > digits(xres) <- rep(0, 7) > addtorow <- list() > addtorow$pos <- list() > addtorow$pos[[1]] <- c(0, 2) > addtorow$pos[[2]] <- 4 > addtorow$command <- c('\vspace{2mm} \n', '\vspace{10mm} \n') > print(xres, add.to.row = addtorow, include.rownames = FALSE, + include.colnames = TRUE, only.contents = TRUE, + hline.after = c(0, 0, 9, 9)) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 1 & 2 & 3 & 4 & 5 & 6 \\ space{2mm} \hline \hline 1 & 7 & 6 & 6 & 5 & 9 \\ 1 & 1 & 1 & 5 & 7 & 7 \\ space{2mm} 7 & 3 & 9 & 8 & 0 & 5 \\ 0 & 0 & 4 & 1 & 5 & 2 \\ space{10mm} 4 & 1 & 8 & 5 & 7 & 1 \\ 2 & 4 & 5 & 9 & 5 & 4 \\ 6 & 3 & 3 & 5 & 5 & 8 \\ 7 & 6 & 1 & 0 & 7 & 6 \\ 4 & 4 & 8 & 8 & 3 & 2 \\ \hline \hline > > ## Demonstrate include.rownames, include.colnames, > ## only.contents and add.to.row arguments in Rweave files > > ## Not run: > \begin{small} Error: unexpected input in "\" > \setlongtables Error: unexpected input in "\" > \begin{longtable}{ Error: unexpected input in "\" > <>= Error: unexpected input in " <<" > cat(paste(c('c', rep('cc', 34/2-1), 'c'), collapse = '@{\hspace{2pt}}')) Error: '\h' is an unrecognized escape in character string starting "'@{\h" > @ Error: unexpected '@' in " @" > } Error: unexpected '}' in "}" > \hline Error: unexpected input in "\" > \endhead Error: unexpected input in "\" > \hline Error: unexpected input in "\" > \endfoot Error: unexpected input in "\" > <>= Error: unexpected input in "<<" > library(xtable) > set.seed(2345) > res <- matrix(sample(0:9, size = 34*90, replace = TRUE), ncol = 34, nrow = 90) > xres <- xtable(res) > digits(xres) <- rep(0, 35) > addtorow <- list() > addtorow$pos <- list() > addtorow$pos[[1]] <- c(seq(4, 40, 5), seq(49, 85, 5)) > addtorow$pos[[2]] <- 45 > addtorow$command <- c('\vspace{2mm} \n', '\newpage \n') > print(xres, add.to.row = addtorow, include.rownames = FALSE, + include.colnames = FALSE, only.contents = TRUE, hline.after = NULL) % latex table generated in R 3.1.1 by xtable 1.7-3 package % Wed Mar 04 10:23:17 2015 1 & 5 & 9 & 6 & 9 & 2 & 4 & 1 & 1 & 6 & 6 & 3 & 2 & 4 & 7 & 8 & 6 & 3 & 4 & 9 & 6 & 8 & 9 & 7 & 6 & 9 & 2 & 8 & 9 & 3 & 3 & 3 & 6 & 0 \\ 1 & 7 & 3 & 1 & 2 & 4 & 2 & 6 & 6 & 5 & 5 & 0 & 0 & 0 & 3 & 4 & 6 & 4 & 2 & 8 & 4 & 6 & 0 & 2 & 4 & 3 & 5 & 7 & 3 & 6 & 8 & 9 & 3 & 5 \\ 7 & 1 & 3 & 1 & 9 & 8 & 5 &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