[R] Bug in bitmap producing pdf???

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Dec 15 18:22:42 CET 2000


On Fri, 15 Dec 2000, BXC (Bendix Carstensen) wrote:

> I thought I was clever.
> I produce both ps and pdf files from LaTeX (MiKTeX), so
> sometimes I need to get .eps graphs from R, sometmes .pdf.
> 
> To rationalize this I wrote the following function to let me
> easily choos what I want wihtou changing the code in my
> R-programs too much (here embedded in a small test program):
> 
> plt <- 
> function( file,
>           type = "pdf",
>            dir = options()$grdir,
>         height = 7,
>          width = 7,
>          paper = "special",
>            ... ) 
> {
> if ( type=="pdf" )
> {
> print ( paste( dir, file, ".pdf", sep="" ) ) #just cheking...
>    bitmap( file = paste( dir, file, ".pdf", sep="" ),
>            type = "pdfwrite",
>          height = height,
>           width = width,
>             ... )
> }
> 
> if ( type=="eps" )
> {
> print ( paste( dir, file, ".eps", sep="" ) ) #just checking...
>    postscript( file = paste( dir, file, ".eps", sep="" ),
>              height = height,
>               width = width,
>          horizontal = F,
>               paper = paper,
>                 ... )
> }
> par( mgp=c(2,0.7,0) )
> }
> 
> # If not set plots will be in pdf-format
>  options( grdir="../eps/" )
> 
> pl.type <- "eps"  
> plt( file="ar", pl.type )
> plot(1,1) 
> 
> pl.type <- "pdf"  
> plt( file="ar", pl.type )
> plot(1,1) 
> 
> But what I get is:
> 
> > version
>          _         
> platform Windows   
> arch     x86       
> os       Win32     
> system   x86, Win32
> status             
> major    1         
> minor    1.1       
> year     2000      
> month    August    
> day      15        
> language R         
> > source("xx.r") # This is where the above code is
> [1] "../eps/ar.eps"
> [1] "../eps/ar.pdf"
> Error in tempfile("Rbit") : cannot find unused tempfile name
> > 
> 
> The error comes with the pdf-bit even if I interchange the two 
> parts doing the different kinds of files.
> 
> Any clues??

Try cleaning out your temp directory? The message is that it cannot
create a file with name starting with Rbit in that directory.
This is a file system problem, not a bitmap() problem.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list