From mtmorgan at fhcrc.org  Thu Sep 20 02:25:58 2007
From: mtmorgan at fhcrc.org (Martin Morgan)
Date: Wed, 19 Sep 2007 17:25:58 -0700
Subject: [Rd] Sweave vignettes and bitmap on windows
Message-ID: <6phbqbyp4h5.fsf@gopher4.fhcrc.org>

During vignette generation on Windows, Sweave seems to clean up before
all graphics files are completely processed. For instance, if tmp.Rnw
is:

\documentclass[12pt]{article}
\begin{document}
<<>>=
bitmap("afile.png")
plot(1:100)
dev.off()
@ 
\end{document}

Then:

C:\R\tmp>R CMD Sweave tmp.Rnw
Writing to file tmp.tex
Processing code chunks ...
 1 : echo term verbatim

You can now run LaTeX on 'tmp.tex'

C:\R\tmp>Error: /undefinedfilename in (C:\\DOCUME~1\\mtmorgan\\LOCALS~1\\Temp\\R
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
  --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1126/1686(ro)(G)--   --dict:0/20(G)--   --dict:70/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
AFPL Ghostscript 8.54: Unrecoverable error, exit code 1

Note Sweave finishes before the error message appears.  Adding
Sys.sleep(10) appears to give ghostscript a chance to finish, and no
error message is generated.

Are there solutions to this?

C:\R\tmp>R --version
R version 2.6.0 alpha (2007-09-05 r42789)
Copyright (C) 2007 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License version 2.
For more information about these matters see
http://www.gnu.org/licenses/.

Thanks,
-- 
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org



[Rd] Sweave vignettes and bitmap on windows
Martin Morgan