testing.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml"
  4. lang="en" xml:lang="en">
  5. <head>
  6. <title>testing</title>
  7. <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
  8. <meta name="generator" content="Org-mode"/>
  9. <meta name="generated" content="2009-02-05 15:41:29 PST"/>
  10. <meta name="author" content="Eric Schulte"/>
  11. <style type="text/css">
  12. <!--/*--><![CDATA[/*><!--*/
  13. html { font-family: Times, serif; font-size: 12pt; }
  14. .title { text-align: center; }
  15. .todo { color: red; }
  16. .done { color: green; }
  17. .tag { background-color:lightblue; font-weight:normal }
  18. .target { }
  19. .timestamp { color: grey }
  20. .timestamp-kwd { color: CadetBlue }
  21. p.verse { margin-left: 3% }
  22. pre {
  23. border: 1pt solid #AEBDCC;
  24. background-color: #F3F5F7;
  25. padding: 5pt;
  26. font-family: courier, monospace;
  27. font-size: 90%;
  28. overflow:auto;
  29. }
  30. table { border-collapse: collapse; }
  31. td, th { vertical-align: top; }
  32. dt { font-weight: bold; }
  33. div.figure { padding: 0.5em; }
  34. div.figure p { text-align: center; }
  35. .linenr { font-size:smaller }
  36. .code-highlighted {background-color:#ffff00;}
  37. .org-info-js_info-navigation { border-style:none; }
  38. #org-info-js_console-label { font-size:10px; font-weight:bold;
  39. white-space:nowrap; }
  40. .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
  41. font-weight:bold; }
  42. /*]]>*/-->
  43. </style>
  44. <script type="text/javascript">
  45. <!--/*--><![CDATA[/*><!--*/
  46. function CodeHighlightOn(elem, id)
  47. {
  48. var target = document.getElementById(id);
  49. if(null != target) {
  50. elem.cacheClassElem = elem.className;
  51. elem.cacheClassTarget = target.className;
  52. target.className = "code-highlighted";
  53. elem.className = "code-highlighted";
  54. }
  55. }
  56. function CodeHighlightOff(elem, id)
  57. {
  58. var target = document.getElementById(id);
  59. if(elem.cacheClassElem)
  60. elem.className = elem.cacheClassElem;
  61. if(elem.cacheClassTarget)
  62. target.className = elem.cacheClassTarget;
  63. }
  64. /*]]>*/-->
  65. </script>
  66. </head><body>
  67. <h1 class="title">testing</h1>
  68. <div id="table-of-contents">
  69. <h2>Table of Contents</h2>
  70. <div id="text-table-of-contents">
  71. <ul>
  72. <li><a href="#sec-1">1 Sweave and org-mode </a>
  73. <ul>
  74. <li><a href="#sec-1.1">1.1 Use the Sweave package for latex formatting </a></li>
  75. <li><a href="#sec-1.2">1.2 R blocks </a>
  76. <ul>
  77. <li><a href="#sec-1.2.1">1.2.1 R code that is not printed </a></li>
  78. <li><a href="#sec-1.2.2">1.2.2 R code that is printed </a></li>
  79. <li><a href="#sec-1.2.3">1.2.3 R code that references other blocks </a></li>
  80. </ul>
  81. </li>
  82. <li><a href="#sec-1.3">1.3 Inline references to R data </a>
  83. <ul>
  84. <li><a href="#sec-1.3.1">1.3.1 Used in text </a></li>
  85. <li><a href="#sec-1.3.2">1.3.2 Used in a table </a></li>
  86. </ul>
  87. </li>
  88. <li><a href="#sec-1.4">1.4 Single-line R commands </a></li>
  89. <li><a href="#sec-1.5">1.5 Graphics </a></li>
  90. </ul>
  91. </li>
  92. </ul>
  93. </div>
  94. </div>
  95. <div id="outline-container-1" class="outline-2">
  96. <h2 id="sec-1">1 Sweave and org-mode </h2>
  97. <div id="text-1">
  98. <p>If you're reading a PDF version of this document, you should also
  99. look at <a href="testing.Rorg">testing.Rorg</a> (the source file) and <a href="testing.html">testing.org</a> (the output
  100. of the Sweave process).
  101. </p>
  102. <p>
  103. Keep in mind that one of the advantages of a block-based approach is
  104. using \texttt{C-'} to edit code in its native mode.
  105. </p>
  106. </div>
  107. <div id="outline-container-1.1" class="outline-3">
  108. <h3 id="sec-1.1">1.1 Use the Sweave package for latex formatting </h3>
  109. <div id="text-1.1">
  110. <p>Org allows us to issue commands to be included in \{LaTeX} export.
  111. </p>
  112. </div>
  113. </div>
  114. <div id="outline-container-1.2" class="outline-3">
  115. <h3 id="sec-1.2">1.2 R blocks </h3>
  116. <div id="text-1.2">
  117. <p>The first argument to an R block when using Sweave is the label for
  118. that block.
  119. </p>
  120. <p>
  121. Not all R blocks are printed. Sweave options allow the printing of
  122. the evaluated code, the output of the code, both, or neither.
  123. </p>
  124. </div>
  125. <div id="outline-container-1.2.1" class="outline-4">
  126. <h4 id="sec-1.2.1">1.2.1 R code that is not printed </h4>
  127. <div id="text-1.2.1">
  128. <div id="R-1">
  129. <pre>
  130. > a <- 3
  131. > b <- 6
  132. </pre>
  133. </div>
  134. </div>
  135. </div>
  136. <div id="outline-container-1.2.2" class="outline-4">
  137. <h4 id="sec-1.2.2">1.2.2 R code that is printed </h4>
  138. <div id="text-1.2.2">
  139. <div id="R-2">
  140. <pre>
  141. > c <- 4
  142. </pre>
  143. </div>
  144. <p>
  145. We can use block labels to embed blocks by reference (even if they
  146. weren't printed before).
  147. </p></div>
  148. </div>
  149. <div id="outline-container-1.2.3" class="outline-4">
  150. <h4 id="sec-1.2.3">1.2.3 R code that references other blocks </h4>
  151. <div id="text-1.2.3">
  152. <div id="R-3">
  153. <pre>
  154. > #+R_CODEREF: hidden_block
  155. > #+R_CODEREF: visible_block
  156. > a + b +c
  157. </pre>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. <div id="outline-container-1.3" class="outline-3">
  163. <h3 id="sec-1.3">1.3 Inline references to R data </h3>
  164. <div id="text-1.3">
  165. <p>We can evaluate R code inline.
  166. </p>
  167. </div>
  168. <div id="outline-container-1.3.1" class="outline-4">
  169. <h4 id="sec-1.3.1">1.3.1 Used in text </h4>
  170. <div id="text-1.3.1">
  171. <p>The value of <code>a</code> is 3.
  172. </p>
  173. </div>
  174. </div>
  175. <div id="outline-container-1.3.2" class="outline-4">
  176. <h4 id="sec-1.3.2">1.3.2 Used in a table </h4>
  177. <div id="text-1.3.2">
  178. <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
  179. <col align="left"></col><col align="left"></col><col align="left"></col><col align="left"></col>
  180. <thead>
  181. <tr><th>a</th><th>b</th><th>c</th><th>TOTAL</th></tr>
  182. </thead>
  183. <tbody>
  184. <tr><td>3</td><td>6</td><td>4</td><td>13</td></tr>
  185. </tbody>
  186. </table>
  187. </div>
  188. </div>
  189. </div>
  190. <div id="outline-container-1.4" class="outline-3">
  191. <h3 id="sec-1.4">1.4 Single-line R commands </h3>
  192. <div id="text-1.4">
  193. <p>If we want a line of R code to be evaluated but not printed,
  194. there's a convenient shorthand. This only works for single lines
  195. of R code, but you can have more than one in a row.
  196. </p>
  197. </div>
  198. </div>
  199. <div id="outline-container-1.5" class="outline-3">
  200. <h3 id="sec-1.5">1.5 Graphics </h3>
  201. <div id="text-1.5">
  202. <p>We use values defined elsewhere in the buffer to produce this
  203. graph. The new CAPTION and LABEL arguments work just fine.
  204. </p>
  205. <div id="R-4">
  206. <pre>
  207. > print(xyplot(speed ~ dist, cars,
  208. > panel = function (x, y, ...) {
  209. > panel.xyplot(x, y, ...)
  210. > panel.abline(h=a)
  211. > panel.abline(v=b)
  212. > }))
  213. </pre>
  214. </div>
  215. <p>
  216. <a href="e.eps">file:e.eps</a>
  217. </p></div>
  218. </div>
  219. </div>
  220. <div id="postamble"><p class="author"> Author: Eric Schulte
  221. <a href="mailto:schulte.eric@gmail.com">&lt;schulte.eric@gmail.com&gt;</a>
  222. </p>
  223. <p class="date"> Date: 2009-02-05 15:41:29 PST</p>
  224. <p>HTML generated by org-mode 6.20f in emacs 23</p>
  225. </div></body>
  226. </html>