0

My example is:

\documentclass[12pt]{article}
\begin{document}
<<eg, dev='tikz', size='normalsize', echo=FALSE, message=FALSE, warning=FALSE>>=
require(ggplot2)
ggplot(cars) + geom_histogram(aes(speed), binwidth=1) + xlab("\$")
@    
\end{document}

When running knitr, I get the error: "\$" is an unrecognized escape in character string starting ""\$".

Using "$" also gives an error.

How do I get the symbol '$' to appear here?

1 Answer 1

1

I just worked it out. Using the option sanitize=TRUE in the knitr chunk and using $ without the escape character works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .