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:> 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. > > ______________________________________________ > 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. >
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. -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___ Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Average minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) ..... Eleanor Roosevelt ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
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:> 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 canGenerally 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.> > -- > 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. >-- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, ATS Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/