Sweave
and LaTeX
Sweave
and LaTeX
: LaTeX
"preamble" to use in your .nw file: Sweave.Template.nw
Sweave
Manual and example .nw Sweave
files used in the Sweave
manual can be found here.
LaTeX
can be found here.
Sweave
from within Emacs
\end{document}
expression if you get the following error from Sweave
:Warning message:
incomplete final line found by readLines on `blah.nw'
.nw
file: %
(percent) signs (the LaTeX
comment symbol) to comment out lines of text and whole R code chunks (i.e., from the <<>>=
to the @
headers).
#
(number) signs (the R comment symbol) to comment out lines of R code within an R code chunk (i.e., between the <<>>=
to the @
headers).
Sweave
to run outside of R (i.e., from a konsole command prompt): ~/bin
(i.e., /home/scottt/bin
) directory: cd ~\bin
~/bin
directory to see if a Sweave
shell script is already present: ls
Sweave
is listed in the contents of the directory, open Sweave
in a text editor (here I use pico
): pico Sweave
Sweave
is not present, open a new file to be named Sweave
in a text editor (again using pico
): pico Sweave
Sweave
was already present, make sure the opened file contains the following two lines (make sure it matches exactly). If Sweave
was not present, type the following lines in the text editor: #!/bin/sh
echo "library(tools) ; Sweave(\"$1.nw\")" | R --no-save --no-restore
rm -f Rplots.ps graphics/*.eps
pdflatex
so you don't need to keep eps
files
pico
by typing Ctrl+X
to save the Sweave
file (answer Yes
to saving changes, and keep the name of the file as Sweave
).
Sweave
as a shell script: chmod +x
~/bin
directory. cd ~
.bashrc
(a hidden file) in a text editor: pico .bashrc
export PATH=$PATH:~/bin
pico
by typing Ctrl+X
to save your .bashrc
file (answer Yes
to saving changes, and keep the name of the file as .bashrc
).
Sweave
documents. .nw
file used to create the linked pdf file: RCitation.nw
.bib
file to create and reference: Rbiblioref.bib
upData()
function invocation to generate a long variable label that will automatically wrap in the LaTeX
version of a summary.formula()
(with reverse = TRUE
) table. The strwrap()
function width=
argument will dictate how wide the label is.