I'm running the latest RStudio (0.97.551) and R (3.0.1) version on Mac OS X Mountain Lion 10.8.4.
I have the following two files: test.Rnw
\documentclass{article}
<<set-options, echo=FALSE>>=
options(replace.assign=TRUE)
opts_chunk$set(external=TRUE, cache=TRUE, echo=FALSE, fig=TRUE)
read_chunk('chunks.R')
@
\begin{document}
\section{Graphics}
<<chart, fig.height=4>>=
@
\end{document}
and chunks.R
## @knitr chart
library(ggplot2, quietly=TRUE)
Sys.sleep(3)
p <- ggplot(mtcars, aes(wt, mpg)) + geom_point(aes(size = qsec)) +
labs(title ="title with umlauts ä")
p
sessionInfo()
When knitting this document in RStudio everything is fine:
Now I clear the cache and knit the document manually from a script running the commands:
export TEXINPUTS=$TEXINPUTS:/Library/Frameworks/R.framework/Versions/Current/Resources/share/texmf/tex/latex/
/usr/bin/Rscript -e "library(knitr); knit(\"test.Rnw\")"
pdflatex ./test.tex
Everything is still fine.
But then I don't clear the cache and knit again in RStudio. the PDF-viewer of RStudio now displays the chart as follows:
Mac OS X Preview shows both pdfs fine. The only difference in sessionInfo() I can see is the order of the base packages.
Has anyone an idea why RStudio shows the graphic wrong?
I don't know how to share the two pdfs. So if anyone needs them and tells me how to share them, I'll do it.
TIA, JW