Up to this morning Sweave() was regularly creating images in png format (I used png=T as an argument).
At some point Sweave would no longer create any PNG image (this is a problem for me 'cause running MikTeX I found tricky managing pdf or eps pics).
Now I have checked over any possible modification and inadvertences in the .Rnw file ultimately even retrieving files from my usb that used to work normally yesterday, I have shut off R session many times to reset possible unwanted changes to the settings, result= nothing.
It is like all of a sudden Sweave would not work properly anymore. I know this does not make sense, in fact is quite odd thing happening to me since!
Any suggestion is appreciated
PS: Only thing I've been thinking to is me messing around with getOption(default=) and option(default=), but as I said I relaunched brand new R sessions several times to be sure normal settings were restored.
My R platform is:
R version 2.11.1 (2010-05-31)
i386-pc-mingw32
locale:
[1] LC_COLLATE=Italian_Italy.1252 LC_CTYPE=Italian_Italy.1252
[3] LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C
[5] LC_TIME=Italian_Italy.1252
attached base packages:
[1] tools stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] xtable_1.5-6 AICcmodavg_1.14 nlme_3.1-96 aod_1.2
loaded via a namespace (and not attached):
[1] grid_2.11.1 lattice_0.18-8
I run on MiKTeX 2.9.
Consider this trivial example:
% .Rnw file
\documentclass{article}
\usepackage{Sweave}
\SweaveOpts{keep.source=TRUE}
\begin{document}
\title{INTERNAL REPORT}
\date{}
\author{\textbf{Federico Bonofiglio}}
\maketitle
<<echo=F>>=
options(prompt=" ", continue= " ")
<<>>=
x<-rnorm(500,mean=3)
mean(x)
@
\begin{figure}
<<fig=T>>=
plot(x)
@
\caption(ciao)
\end{figure}
@
\end{document}
and the R code is:
setwd("C:\\your folder")
Sweave("prova",png= T, pdf=F)
library(tools)
texi2dvi("prova.tex",pdf=T)
NOTE that the Sweave command above has been working nicely for me up to this morning (i.e. producing PNG files and not EPS or PDF ones).
I'm very puzzled and frustrated. It seems like Sweave() has forgot about the PNG option.
@after youroptionscommand and an extra@at the end. – Aaron Sep 22 '11 at 14:44