Andrew Ellis wrote:
You cannot have \label in an S chunk, as R will not know what to do
with it. Neither can you have \label in a verbatim environment, as it
will simply be typeset verbatim.
Actually, with your definition of Sinput
\DefineVerbatimEnvironment{Sinput}{Verbatim} {
commentchar=@,
frame=lines, label=\textrm{\bf R code}, numbers=left,
framesep=10pt, fontshape=sl, commandchars=\\\{\}}
you can have \label{} in the verbatim environment. I haven't tried this
but something like
<<>>=
help() # \label{line1}
@
might work, and I believe there is a switch that suppresses the comments
for Sweave
-Michael
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.