I am trying to print R code in a latex document using knitr.
I have the following simple code:
\begin{frame}{Plot Code}
<<plotcode,eval=FALSE,echo=TRUE,results='markup;$=\\$'>>=
... a simple lm from randomly received data ...
yhat.fit <- yhat$fit[,"fit"]
... simpler code ...
\end{frame}
This will start, BUT, there is no replacement for the $ sign. Instead, I get the math mode for fit [, "fit"] in the slide (along with the "missing inserted" errors from pdflatex compilation.
I would rather not have a math mode; instead, I would like to see the $ sign, since it is an integral part of the R code.
, $ \$ .tex, , - , , . , , .