testing.tex 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. % Created 2009-02-08 Sun 11:18
  2. \documentclass[11pt]{article}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[T1]{fontenc}
  5. \usepackage{graphicx}
  6. \usepackage{longtable}
  7. \usepackage{hyperref}
  8. \usepackage{Sweave}
  9. \title{testing}
  10. \author{Dan}
  11. \date{08 February 2009}
  12. \begin{document}
  13. \maketitle
  14. \setcounter{tocdepth}{3}
  15. \tableofcontents
  16. \vspace*{1cm}
  17. \section{Sweave and org-mode}
  18. \label{sec-1}
  19. If you're reading a PDF version of this document, you should also
  20. look at \href{file:///home/dan/src/rorg/existing_tools/RweaveOrg/testing.Rorg}{testing.Rorg} (the source file) and \href{file:///home/dan/src/rorg/existing_tools/RweaveOrg/testing.org}{testing.org} (the output
  21. of the Sweave process).
  22. Keep in mind that one of the advantages of a block-based approach is
  23. using \texttt{C-'} to edit code in its native mode.
  24. \subsection{R code that is not printed}
  25. \label{sec-1.3}
  26. \subsection{R code that is printed}
  27. \label{sec-1.4}
  28. \begin{Schunk}
  29. \begin{Sinput}
  30. > c <- 4
  31. \end{Sinput}
  32. \end{Schunk}
  33. We can use block labels to embed blocks by reference (even if they
  34. weren't printed before).
  35. \subsection{R code that references other blocks}
  36. \label{sec-1.5}
  37. \begin{Schunk}
  38. \begin{Sinput}
  39. > a <- 3
  40. > b <- 6
  41. > c <- 4
  42. > a + b + c
  43. \end{Sinput}
  44. \begin{Soutput}
  45. [1] 13
  46. \end{Soutput}
  47. \end{Schunk}
  48. \subsection{Used in text}
  49. \label{sec-1.7}
  50. The value of \verb=a= is 3.
  51. \subsection{Used in a table}
  52. \label{sec-1.8}
  53. \begin{center}
  54. \begin{tabular}{rrrr}
  55. a & b & c & TOTAL \\
  56. \hline
  57. 3 & 6 & 4 & 13 \\
  58. \end{tabular}
  59. \end{center}
  60. \end{document}