r - Why does RStudio show the manually knitted pdf wrong? -


i'm running latest rstudio (0.97.551) , r (3.0.1) version on mac os x mountain lion 10.8.4.

i have following 2 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 umlauts รค") p sessioninfo()  

when knitting document in rstudio fine:

generated rstudio

now clear cache , knit document manually script running 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 still fine.

but don't clear cache , knit again in rstudio. pdf-viewer of rstudio displays chart follows:

regenerated rstudio after chunks generated manually

mac os x preview shows both pdfs fine. difference in sessioninfo() can see order of base packages.

has idea why rstudio shows graphic wrong?

i don't know how share 2 pdfs. if needs them , tells me how share them, i'll it.

tia, jw

rstudio sets grdevices::pdf.options(usedingbats = false) before calls knitr (see panel compile pdf contains log), , option usedingbats true default in r. rstudio's built-in pdf viewer not honor dingbats font, circles (solid points) broken in pdf viewer when usedingbats = true. see ?pdf more information.

you should not use rstudio's pdf viewer view pdf generated outside of rstudio yourself. there other choices in tools -> options -> sweave -> pdf preview, such sumutra pdf under windows, , evince under linux. have no idea mac os x, though (at least can use default viewer of system, believe).


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -