'\end{document}'expression if you get the following error from Sweave:
Warning message: incomplete final line found by readLines on `blah.nw'
%
to comment out lines of text and whole R code chunks (from the <<>>=
to the @
).
#
to comment out lines of R code within an R code chunk (between the <<>>=
to the @
).
~/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
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
).