You are not logged in.
[extra]/r was recently updates from 3.0.3-1 to 3.1.0-1. With this update I lost the ability to compile Sweave documents. I was only able to trace it to the following command *not* producing the figure image files even though no errors are generated:
R CMD Sweave document.Rnw
Downgrading to 3.0.3-1 resolves the issue.
Here is a minimal Sweave document that works with 3.0.3-1 but fails with 3.1.0-1:
\documentclass{article}
\SweaveOpts{prefix=FALSE}
\begin{document}
<<stats0,echo=FALSE>>=
a = 1
@
<<fig1,fig=TRUE,echo=FALSE>>=
plot(a)
@
\end{document}
I'm not sure what next steps to take in investigating, so any input would be appreciated. As a first step I'd like to know if other Sweave users can replicate this issue or if mine is an isolated case.
Last edited by Trilby (2014-06-05 01:31:49)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I can replicate the issue with a custom R-3.1 compilation. This works though
$ Rscript -e 'Sweave("a.Rnw")'
Writing to file a.tex
Processing code chunks with options ...
1 : keep.source term verbatim (label = stats0, a.Rnw:7)
2 : keep.source term verbatim pdf (label = fig1, a.Rnw:11)
You can now run (pdf)latex on ‘a.tex’
(a.Rnw is your minimal example). here they report the same problem so I don't think it's arch specific. I quote "Basically 'R CMD Sweave' is partly broken in R 3.1.0.". I didn't read the whole thread though...
Offline
Thanks! Perfect answer. I always struggle googling for things related to r. It's not exactly a unique letter.
I hope this is a bug that will be fixed, but for now the Rscript approach works perfectly well.
In case it helps other users, here's that command in the context of a before and after vim keybinding to generate, view, and cleanup regeneratable files:
"Sweave
"au BufNewFile,BufRead *.Rnw nmap <F5> ;w<CR>;silent !R CMD Sweave "%"; latexmk -quiet -pv "%:r"; latexmk -c "%:r"; rm "%:r".tex<CR><CR>;redraw!<CR>
au BufNewFile,BufRead *.Rnw nmap <F5> ;w<CR>;silent !Rscript -e 'Sweave("%")'; latexmk -quiet -pv "%:r"; latexmk -c "%:r"; rm "%:r".tex<CR><CR>;redraw!<CR>
I've opened a bug report on R's bug tracker.
Last edited by Trilby (2014-04-15 15:41:07)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
should be fixed in 3.1.0-2
Offline
Thanks for following up on this pressh - I realize in the report I filed on our bugtracker (after an upstream patch was made available) that the upstream patch wasn't added to the upstream "vanilla" source, but only to a "r-patched" branch. I'm glad too see this incorporated into our package and just confirmed it is working as intended.
EDIT: changed thread from [known bug w/ workaround] to [solved]
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I always struggle googling for things related to r.
It probably wouldn't have helped in this case, but FYI:
Offline