0

I am editing a .rnw file in R Studio. This is a project summary. For the project, I used both R code and bash script.

For the R code, I am using the typical syntax to actually execute the code in the file, as such:

<<>>=
Code in between these symbols executes
@ 

However, for the bash scripts, I do not want them to actually execute, but I want to include them in the same .rnw file so that a reader can view them and copy/paste them etc. Is there such a syntax to make non-executable code look like code separated from the text, while not actually running it?

ElRStar
  • 313
  • 4
  • 15

1 Answers1

1

I suppose you are looking for eval = FALSE:

<<eval=FALSE>>=
some code here
@

However, you could always just use the "verbatim" environment, which would be more appropriate for non-R code.

\begin{verbatim}
some code here
\end{verbatim}
A5C1D2H2I1M1N2O1R2T1
  • 190,393
  • 28
  • 405
  • 485