Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. begin{table}[ht]
  2. begin{center}
  3. begin{tabular}{rrrrrrr}
  4. hline
  5. & 1 & 2 & 3 & 4 & 5 & 6 \
  6. hline
  7. 1 & 181.21 & 169.01 & 130.03 & 135.93 & 142.31 & 108.11 \
  8. 2 & 106.80 & 130.71 & 186.43 & 126.46 & 167.28 & 137.91 \
  9. 3 & 162.69 & 198.98 & 188.33 & 184.30 & 147.02 & 197.38 \
  10. 4 & 132.42 & 150.50 & 148.69 & 134.31 & 129.52 & 172.72 \
  11. hline
  12. end{tabular}
  13. end{center}
  14. end{table}
  15.  
  16. ! Undefined control sequence.
  17. l.1 begin
  18. {table}[ht]
  19. ?
  20. Process interrupted by user
  21.  
  22. ## Standard xtable use
  23. print(xtable(summary(npk.aov)))
  24.  
  25. % latex table generated in R 2.12.2 by xtable 1.5-6 package
  26. % Fri Aug 12 16:00:48 2011
  27. begin{table}[ht]
  28. begin{center}
  29. begin{tabular}{lrrrrr}
  30. hline
  31. & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \
  32. hline
  33. block & 5 & 343.29 & 68.66 & 4.45 & 0.0159 \
  34. N & 1 & 189.28 & 189.28 & 12.26 & 0.0044 \
  35. P & 1 & 8.40 & 8.40 & 0.54 & 0.4749 \
  36. K & 1 & 95.20 & 95.20 & 6.17 & 0.0288 \
  37. N:P & 1 & 21.28 & 21.28 & 1.38 & 0.2632 \
  38. N:K & 1 & 33.13 & 33.13 & 2.15 & 0.1686 \
  39. P:K & 1 & 0.48 & 0.48 & 0.03 & 0.8628 \
  40. Residuals & 12 & 185.29 & 15.44 & & \
  41. hline
  42. end{tabular}
  43. end{center}
  44. end{table}
  45.  
  46. documentclass{article}
  47. begin{document}
  48. ...
  49. end{document}
  50.  
  51. % latex table generated in R 2.12.2 by xtable 1.5-6 package
  52. % Fri Aug 12 16:29:29 2011
  53. begin{tabular}{lrrrrr}
  54. hline
  55. & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \
  56. hline
  57. block & 5 & 343.29 & 68.66 & 4.45 & 0.0159 \
  58. N & 1 & 189.28 & 189.28 & 12.26 & 0.0044 \
  59. P & 1 & 8.40 & 8.40 & 0.54 & 0.4749 \
  60. K & 1 & 95.20 & 95.20 & 6.17 & 0.0288 \
  61. N:P & 1 & 21.28 & 21.28 & 1.38 & 0.2632 \
  62. N:K & 1 & 33.13 & 33.13 & 2.15 & 0.1686 \
  63. P:K & 1 & 0.48 & 0.48 & 0.03 & 0.8628 \
  64. Residuals & 12 & 185.29 & 15.44 & & \
  65. hline
  66. end{tabular}
  67.  
  68. print(xtable(summary(npk.aov)),floating=FALSE,latex.environments=NULL,booktabs=TRUE)
  69.  
  70. > latex(summary(npk.aov)[[1]], cdec=c(0,2,2,2,4), na.blank=TRUE,
  71. booktabs=TRUE, table.env=FALSE, center="none", file="", title="")
  72.  
  73. % latex.default(summary(npk.aov)[[1]], cdec = c(0, 2, 2, 2, 4), na.blank = TRUE, booktabs = TRUE, table.env = FALSE, center = "none", file = "", title = "")
  74. %
  75. begin{tabular}{lrrrrr}
  76. toprule
  77. multicolumn{1}{l}{}&multicolumn{1}{c}{Df}&multicolumn{1}{c}{Sum Sq}&multicolumn{1}{c}{Mean Sq}&multicolumn{1}{c}{F value}&multicolumn{1}{c}{Pr(textgreater F)}tabularnewline
  78. midrule
  79. block &$ 5$&$343.29$&$ 68.66$&$ 4.45$&$0.0159$tabularnewline
  80. N &$ 1$&$189.28$&$189.28$&$12.26$&$0.0044$tabularnewline
  81. P &$ 1$&$ 8.40$&$ 8.40$&$ 0.54$&$0.4749$tabularnewline
  82. K &$ 1$&$ 95.20$&$ 95.20$&$ 6.17$&$0.0288$tabularnewline
  83. N:P &$ 1$&$ 21.28$&$ 21.28$&$ 1.38$&$0.2632$tabularnewline
  84. N:K &$ 1$&$ 33.13$&$ 33.13$&$ 2.15$&$0.1686$tabularnewline
  85. P:K &$ 1$&$ 0.48$&$ 0.48$&$ 0.03$&$0.8628$tabularnewline
  86. Residuals &$12$&$185.29$&$ 15.44$&$$&$$tabularnewline
  87. bottomrule
  88. end{tabular}
  89.  
  90. documentclass{article}
  91. usepackage[margin=1em,paperheight=8cm,paperwidth=12cm]{geometry}
  92. usepackage{booktabs,lipsum}
  93. begin{document}
  94. <<echo=F,message=F,warning=F,comment="">>=
  95. library(xtable)
  96. library(stargazer)
  97. library(kableExtra)
  98. library(Hmisc)
  99. data("mtcars") # some example data
  100. df <-mtcars[1:3, 1:6]
  101. @
  102.  
  103. <<echo=F,results="asis">>=
  104. print(xtable(df,caption="Example with \texttt{xtable}"),
  105. booktabs=T, caption.placement="top")
  106. stargazer(df, summary=F,
  107. title="Example with \texttt{stargazer}")
  108. kable(df, booktabs = T,
  109. caption = "Example with \texttt{kable} and \texttt{kableExtra}")
  110. latex(df, file = '', caption="Example with \texttt{Hmisc}")
  111. @
  112. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement