#+TITLE: This is a test #+AUTHOR: Michael Hannon #+email: address@hidden #+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes * Getting Started ** Batch Mode #+begin_src R :exports code pdf("xh.pdf") # set graphical output file hist(rnorm(100)) # generate 100 N(0,1) variates and plot their histogram dev.off() # close the graphical output file #+end_src If we put the code above in a file called =z.R=, we can execute the code from the command line via: =R CMD BATCH z.R= #+begin_src R x <- c(1, 3, 5) #+end_src #+begin_src R x[3] #+end_src #+begin_src R q <- c(x,x,8) #+end_src #+begin_src R x #+end_src