[R] Invalid device number in savePlot

From: <OlsenN_at_pac.dfo-mpo.gc.ca>
Date: Wed 06 Jul 2005 - 08:16:38 EST


Hi,
I recently encountered an error using the command "savePlot" when trying to save the third of 3 open graph windows. After successfully saving and closing the first two windows I receive an "Invalid device number in savePlot" error. The following is copied and pasted from an example session to illustrate the behaviour:  

> windows()
> hist(rnorm(100))
> windows()
> hist(rnorm(100))
> windows()
> hist(rnorm(100))
> savePlot("foo", "wmf")
> dev.off()

windows

      2
> savePlot("foo", "wmf")
> dev.off()

windows

      3
> savePlot("foo", "wmf")

Error in savePlot("foo", "wmf") : invalid device number in savePlot  

If I check the current active device and manually set this parameter in savePlot, I still receive the error:  

> dev.cur()

windows

      3
> savePlot("foo", "wmf", device=3)

Error in savePlot("foo", "wmf", device = 3) :

        invalid device number in savePlot  

This behaviour is certainly not a critical issue for me so I'm not looking for a solution; I just thought I should report the issue in case it's a bug ... or perhaps I'm simply doing something stupid without realising it. Norm  

WinXP SP2
platform i386-pc-mingw32

arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    2              
minor    1.1            
year     2005           
month    06             
day      20             

language R      

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 06 08:18:41 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:16 EST