# NOT RUN {
testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils")
# }
# NOT RUN {
## enforce par(ask = FALSE)
options(device.ask.default = FALSE)
## create a LaTeX file - in the current working directory, getwd():
Sweave(testfile)
## This can be compiled to PDF by
## tools::texi2pdf("Sweave-test-1.tex")
## or outside R by
##
## R CMD texi2pdf Sweave-test-1.tex
## on Unix-alikes which sets the appropriate TEXINPUTS path.
##
## On Windows,
## Rcmd texify --pdf Sweave-test-1.tex
## if MiKTeX is available.
## create an R source file from the code chunks
Stangle(testfile)
## which can be sourced, e.g.
source("Sweave-test-1.R")
# }
Run the code above in your browser using DataLab