Skip to content

need help in pausing a script

4 messages · M3Mph15, R. Michael Weylandt, Patrick Connolly +1 more

#
Hey, I'm new to R. I wrote a script for doing several statistic tests and
plot. is there any way to add a kind of pause function which halts script
execution until a key is pressed. Please help fast if you can

--
View this message in context: http://r.789695.n4.nabble.com/need-help-in-pausing-a-script-tp3909815p3909815.html
Sent from the R help mailing list archive at Nabble.com.
#
Perhaps something like this (stolen from the demo() code):

readline("\nType  <Return>\t to start : ") # If you don't want the
auto-print "" and are running it interactively, a call to invisible()
might help.

Michael Weylandt
On Sun, Oct 16, 2011 at 12:08 PM, M3Mph15 <d.niemand at onlinehome.de> wrote:
#
On Sun, 16-Oct-2011 at 09:08AM -0700, M3Mph15 wrote:
|> Hey, I'm new to R. I wrote a script for doing several statistic tests and
|> plot. is there any way to add a kind of pause function which halts script
|> execution until a key is pressed. Please help fast if you can

?browser


|> 
|> --
|> View this message in context: http://r.789695.n4.nabble.com/need-help-in-pausing-a-script-tp3909815p3909815.html
|> Sent from the R help mailing list archive at Nabble.com.
|> 
|> ______________________________________________
|> R-help at r-project.org mailing list
|> https://stat.ethz.ch/mailman/listinfo/r-help
|> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
|> and provide commented, minimal, self-contained, reproducible code.
#
In addition to Michael's suggestion, if what you want to pause is the
creation of graphs, set:

par(ask = TRUE)

see ?par for details.  It makes it so that user input is required
between each graph plotting.

Cheers,

Josh
On Sun, Oct 16, 2011 at 9:08 AM, M3Mph15 <d.niemand at onlinehome.de> wrote:
Generally speaking, telling volunteers to respond "fast" is rather
rude (also may hurt your chances of a response because it makes
academics suspicious that it is for an assignment or homework due
soon).  At least some justification (e.g., I work at an animal rescue
and we just saved 3000 baby whales, but we do not have facilities for
all 3000 of them, have little funds and need to find the most cost
effective way to get them to special whale vets all around the
world----also 35 need medical attention quickly, so I need to get this
script working in the next 6 hours so they have time to make it to a
treatment facility and receive life-saving care.) might make some of
us feel better about prioritizing a response to you.