[R] win.metafile use

Guido Masarotto guido at hal.stat.unipd.it
Tue Jul 6 11:59:17 CEST 1999


On Mon, Jul 05, 1999 at 12:00:58PM +0100, D.A.Wooff at durham.ac.uk wrote:
> Platform: Windows 95
> Version : R0641
> 
> Problem : I wish to plot and save a large number of graphics files in
> windows metafont format. I have a very crude postscript printing
> function, which happily handles repeated calls:
> ..................................
> To produce metafont files, I adapt this to, for example, 
> 
>    test<-function(filename){
>       dev.print(device=win.metafile,file=paste(sep="",filename,".wmf"))
>       return()
>    }
> 
> 
> Repeated calls to this function work satisfactorily for the first few
> calls, (e.g 15 calls work, the next does not) but finally it fails

  David,
  I have just now runned the following lines
     for (i in 1:10000) {
        hist(rnorm(100))
        dev.print(win.metafile,paste(i,".wmf",sep="")
        print(i)
     }
  on:
  1) A WinNT system (v4.0,SP4): no problems, Task Manager shows no trend
     in memory and handles usage for Rgui;
  2) A Win95 system (Original version, i.e., never updated since 1995):
     no problems;
  3) A Win98 system (BTW, installed as 1) on my notebook, i.e., sharing
     hardware and R installation with 1)): it blocks around i=65 (small
     differences in different trials).

  Hence, I suspect that you hit on one of the nasty Windows version
  incompatibility problems.
  Today, I will update binaries for Windows at CRAN to R-0.64.2 (using,
  actual metafile handling code).
  After, I will try to understand if I can devise a workaround (suggestions
  are warmly welcomed since my Win32 API manual seems
  useless in this regard: no pointer to a change in the API).  

  In the meantime, could you send me more information on your Windows version
  (and in particular, on the version of gdi32.dll installed (this dll 
   includes the metafile code; locate it, then right-click and choose
   'Properties' from the pop-up menu). Given your and mine results
   I suspect that the problem should be confined in recent versions of Win9X.

  You can also try to look to MS site (http://www.microsoft.com) to understand
  if the problem is known and if an udpdated gdi32.dll is available.

> folowed by corruption of Rgui. 
> 

 What 'corruption' means ? I can reproduce this point (i.e., after failure
 to create a metafile, I cannot create metafiles anymore but the rest of
 the system seems to work).

 guido
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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