After upgrading R to version 3.1.0 (from some version 2.x.x), the following sweave code does not produce any pdfs for the plots anymore:



<<fig = T, echo = F, include=T>>=
\caption{My Graph}


To compile, I use R CMD Sweave foo.Rnw followed by R CMD pdflatex foo.tex. Why is that and how can I fix it? I played around with the options: fig = TRUE, pdf = TRUE and so on - to no avail.

Edit: Here is the output of R CMD Sweave foo.Rnw, which should create the pdf files:

R CMD Sweave foo.Rnw
stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.
Output file:  foo.tex
R CMD pdflatex foo.tex
  • Did you re-install ggplot2 for R version 3?
    – Thruston
    Commented Jul 29, 2014 at 10:32
  • Your example works for me after upgrading to the latest R - but only after I had re-installed ggplot2 and all of its dependencies.
    – Thruston
    Commented Jul 29, 2014 at 10:43
  • @Thruston: sorry, the ggplot library is actually not needed. Even when using the standard plot-function, no pdfs are generated.
    – mort
    Commented Jul 29, 2014 at 11:12
  • Do you get any error messages?
    – Thruston
    Commented Jul 29, 2014 at 11:21
  • No. I'll add the output of the first command to my question.
    – mort
    Commented Jul 29, 2014 at 11:25

1 Answer 1


I updated R to version 3.1.1 (by removing R 3.1.0 and installing R 3.1.1 from source) - and voila, it works!

You must log in to answer this question.

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