[Rd] Windows testing

Duncan Murdoch murdoch@stats.uwo.ca
Wed, 05 Dec 2001 11:46:43 -0500


This is unchanged from 1.3.1, but doesn't look right to me:

If I run the graphics demo to the second prompt, I see:

>> demo(graphics)
>
>
>        demo(graphics)
>        ---- ~~~~~~~~
>
>Type  <Return>   to start : 
>
>> if (dev.cur() <= 1) get(getOption("device"))()
>
>> opar <- par(ask = interactive() && (.Device %in% c("X11", 
>    "GTK", "windows", "Macintosh")))
>
>> x <- rnorm(50)
>
>> opar <- c(opar, par(bg = "white"))
>
>> plot(x, ann = FALSE, type = "n")
>
>Hit <Return> to see next plot: 

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.

Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._