Skip to content
Prev 334733 / 398503 Next

Knitr, ggplot and consistent fonts

Hi Daniel
I tried it in Sweave after modifying it for Sweave and a similar thing for Latex but R crashed.

I think there is an embedded character/s before the first chunk and in the first chunk.

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mackay at northnet.com.au

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of John Kane
Sent: Monday, 23 December 2013 04:19
To: Daniel Haugstvedt; r-help at r-project.org
Subject: Re: [R] Knitr, ggplot and consistent fonts

Hi Daniel, 

For some reason I cannot get your example to work. The problem is in the code chunk but I have no idea what is happening. The code is running perfectly in R, itself but LaTeX seems to be choking when it hits the first ggplot statement, that is the one in <<plot-figHeight>>=

The message I am getting is: "Missing $ inserted <inserted text> $ ggplot(df, aes(x=x)) = geom_" and my knowledge of LateX is not enough to figure out the problem. 

I tried stripping out most of the LaTeX specific verbiage in the code chunk and running the code in LyX which I use rather than plain vanilla LaTeX and I still cannot get it to work. It is almost as if there is some hidden character in the in that piece of code since I can duplicate the code myself and I even pasted in most of the geom_histogram code into my code chunk and it runs. 

John Kane
Kingston ON Canada
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys Works with AIM?, MSN? Messenger, Yahoo!? Messenger, ICQ?, Google Talk? and most webmails

______________________________________________
R-help at 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.