markleeds at verizon.net
2006-Jun-08 16:47 UTC
[R] apologies if you aready received this ?
I am accessing my email account remotely so it seems to be acting strangely so I am not sure if this R question was received. I apologize if it was and thanks for any help you can provide. ----------------------------------------------------------------- Hi Everyone : As I mentioned earlier, I am taking a lot of Splus code and turning into R and I've run into another stumbling block that I have not been able to figure out. I did plotting in a loop when I was using Splus on unix and the way I made the plots stop so I could lookat them as they got plotted ( there are hundreds if not thousands getting plotted sequentially ) on the screen was by using the unix() command. Basically, I wrote a function called wait() wait<-function() { cat("press return to continue") unix("read stuff") } and this worked nicely because I then did source("program name") at the Splus prompt and a plot was created on the screen and then the wait() function was right under the plotting code in the program so that you had to hit the return key to go to the next plot. I am trying to do the equivalent on R 2.20/windows XP I did a ?unix in R and it came back with system() and said unix was deprecated so I replaced unix("read stuff") with system("read stuff") but all i get is a warning "read not found" and it flies through the successive plots and i can't see them. Thanks for any help on this. It's much appreciated.
<markleeds at verizon.net> writes:> Basically, I wrote a function called wait() > > > wait<-function() > { > cat("press return to continue") > unix("read stuff") > }Is readline what you want? See help(readline).
?readline -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of > markleeds at verizon.net > Sent: Thursday, June 08, 2006 9:47 AM > To: r-help at stat.math.ethz.ch > Subject: [R] apologies if you aready received this ? > > I am accessing my email account remotely so it > seems to be acting strangely so I am not sure > if this R question was received. I apologize if it was > and thanks for any help you can provide. > > ----------------------------------------------------------------- > > > Hi Everyone : As I mentioned earlier, I am taking a lot > of Splus code and turning into R and I've run into > another stumbling block that I have not been > able to figure out. > > I did plotting in a loop when I was using Splus on unix > and the way I made the plots stop so I could > lookat them as they got plotted ( there are hundreds > if not thousands getting plotted sequentially ) > on the screen was by using the unix() command. > > Basically, I wrote a function called wait() > > > wait<-function() > { > cat("press return to continue") > unix("read stuff") > } > > and this worked nicely because I then > did source("program name") at the Splus prompt and > a plot was created on the screen and then > the wait() function was right under the plotting code > in the program so that you had to hit the return key to go to > the next plot. > > I am trying to do the equivalent on R 2.20/windows XP > I did a ?unix in R and it came back with system() and > said unix was deprecated so I replaced unix("read stuff") > with system("read stuff") but all i get is a warning "read > not found" and > it flies through the successive plots and i can't see them. > > Thanks for any help on this. It's much appreciated. > > ______________________________________________ > R-help at 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 >
On 6/8/2006 12:47 PM, markleeds at verizon.net wrote:> I am accessing my email account remotely so it > seems to be acting strangely so I am not sure > if this R question was received. I apologize if it was > and thanks for any help you can provide. > > ----------------------------------------------------------------- > > > Hi Everyone : As I mentioned earlier, I am taking a lot > of Splus code and turning into R and I've run into > another stumbling block that I have not been > able to figure out. > > I did plotting in a loop when I was using Splus on unix > and the way I made the plots stop so I could > lookat them as they got plotted ( there are hundreds > if not thousands getting plotted sequentially ) > on the screen was by using the unix() command. > > Basically, I wrote a function called wait() > > > wait<-function() > { > cat("press return to continue") > unix("read stuff") > }You can also use par(ask=TRUE) to get R to pause the script whenever it is about to erase the graphics window. Duncan Murdoch> > and this worked nicely because I then > did source("program name") at the Splus prompt and > a plot was created on the screen and then > the wait() function was right under the plotting code > in the program so that you had to hit the return key to go to the next plot. > > I am trying to do the equivalent on R 2.20/windows XP > I did a ?unix in R and it came back with system() and > said unix was deprecated so I replaced unix("read stuff") with system("read stuff") but all i get is a warning "read not found" and > it flies through the successive plots and i can't see them. > > Thanks for any help on this. It's much appreciated. > > ______________________________________________ > R-help at 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
On Thu, 8 Jun 2006, markleeds at verizon.net wrote:> > Hi Everyone : As I mentioned earlier, I am taking a lot > of Splus code and turning into R and I've run into > another stumbling block that I have not been > able to figure out. > > I did plotting in a loop when I was using Splus on unix > and the way I made the plots stop so I could > lookat them as they got plotted ( there are hundreds > if not thousands getting plotted sequentially ) > on the screen was by using the unix() command. >People have suggested ways to read stuff from the keyboard already. A simpler solution to the underlying problem may be par(ask=TRUE). However, when I have this problem I usually just send all the plots to a PDF file, so I can page through them at my leisure. -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle