[Rd] Windows testing

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
05 Dec 2001 18:35:46 +0100


Duncan Murdoch <murdoch@stats.uwo.ca> writes:

> At this point I have an open graphics window, but the last line hasn't
> executed yet, so it's blank.  As I go through the demo, what shows up
> is always one step behind the text that I see.
> 
> Wouldn't it be better to execute the lines that are shown before
> stopping to get the user's input?
> 
> To do this, the following changes to the script would work:
> 
> 3,4c3,4
> < opar <- par(ask = interactive() &&
> <             (.Device %in% c("X11", "GTK", "gnome", "windows",
> "Macintosh")))
> ---
> > ask <- interactive() && (.Device %in% c("X11", "GTK", "gnome", "windows", "Macintosh"))
> >
> 16c16
> < opar <- c(opar, par(bg="white"))
> ---
> > opar <- par(bg="white")
> 25a26
> > if (ask) readline("Hit enter for next plot...")
> 
> ... and then the last line repeated after each of the plots.

We might, but not for this release. Basically that's just the way
par(ask=T) works: ask *before* plotting to a device. It could ask
afterwards ("Are you through seeing this?") but it doesn't. Presumably
someone considered the alternatives once upon a time...

Personally, I'm more miffed by the fact that par(ask=T) by itself
causes a graphics window to open. This is of course tricky to avoid,
since you need to have the device before setting its parameters. But
it is getting in the way of example(), causing it to rattle off all
graphics output in one go since we wouldn't want to set par(ask=T) on
help pages that generate no graphics.

Of course, we could eventually decide to make the demos more smooth as
you suggested. Don't forget to unset any previous setting of par(ask=)
or you will get asked twice per plot....

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._