Re: [R] pause in function execution

2009-02-10 Thread Fuchs Ira
Oops...forgot to print(getQuote("AAPL"). Sorry. On Feb 10, 2009, at 10:21 AM, Fuchs Ira wrote: I tried using the command-line and indeed it does not buffer so that, for example: for (i in 1:5) { print(x) Sys.sleep(3) } does as expected. However, the following sleeps for 15 seconds and th

Re: [R] pause in function execution

2009-02-10 Thread Fuchs Ira
I tried using the command-line and indeed it does not buffer so that, for example: for (i in 1:5) { print(x) Sys.sleep(3) } does as expected. However, the following sleeps for 15 seconds and then produces no output: library("quantmod") for (i in 1:5) { getQuote("AAPL") Sys.sleep(3) }

Re: [R] pause in function execution

2009-02-09 Thread Fuchs Ira
The binary in R.app starts the GUI. I suppose I would have to install the command-line version separately. On Feb 9, 2009, at 7:12 PM, Rolf Turner wrote: On 10/02/2009, at 12:55 PM, Duncan Murdoch wrote: On 09/02/2009 6:27 PM, Fuchs Ira wrote: a=function() { print("start") print(Sys.time(

Re: [R] pause in function execution

2009-02-09 Thread Rolf Turner
On 10/02/2009, at 12:55 PM, Duncan Murdoch wrote: On 09/02/2009 6:27 PM, Fuchs Ira wrote: a=function() { print("start") print(Sys.time()) Sys.sleep(5) print(Sys.time()) print("end") } a() results in: [1] "start" [1] "2009-02-09 18:25:41 EST" [1] "2009-02-09 18:25:46 EST" [1] "end" all prin

Re: [R] pause in function execution

2009-02-09 Thread Duncan Murdoch
On 09/02/2009 6:27 PM, Fuchs Ira wrote: a=function() { print("start") print(Sys.time()) Sys.sleep(5) print(Sys.time()) print("end") } a() results in: [1] "start" [1] "2009-02-09 18:25:41 EST" [1] "2009-02-09 18:25:46 EST" [1] "end" all printed together after 5 seconds. The reason for this m

Re: [R] pause in function execution

2009-02-09 Thread Rolf Turner
On 10/02/2009, at 12:09 PM, Fuchs Ira wrote: Yes, Windows has that in the Misc menu, but I don't see a way to do this on the Mac. In my experience output is not buffered on a Mac. Are you sure you're *printing* the output you want to see? Can you provide, as the postin

Re: [R] pause in function execution

2009-02-09 Thread Fuchs Ira
a=function() { print("start") print(Sys.time()) Sys.sleep(5) print(Sys.time()) print("end") } a() results in: [1] "start" [1] "2009-02-09 18:25:41 EST" [1] "2009-02-09 18:25:46 EST" [1] "end" all printed together after 5 seconds. On Feb 9, 2009, at 6:21 PM, Rolf Turner wrote: > > On 10/02/2

Re: [R] pause in function execution

2009-02-09 Thread Remko Duursma
Have you tried flush.console() ? r - Remko Duursma Post-Doctoral Fellow Centre for Plant and Food Science University of Western Sydney Hawkesbury Campus Richmond NSW 2753 Dept of Biological Science Macquarie University North Ryde NSW 2109 Austra

Re: [R] pause in function execution

2009-02-09 Thread Rolf Turner
On 10/02/2009, at 12:09 PM, Fuchs Ira wrote: Yes, Windows has that in the Misc menu, but I don't see a way to do this on the Mac. In my experience output is not buffered on a Mac. Are you actually *printing* out the results you want to see? Could you, as the posting g

Re: [R] pause in function execution

2009-02-09 Thread Fuchs Ira
Yes, Windows has that in the Misc menu, but I don't see a way to do this on the Mac. On Feb 9, 2009, at 5:51 PM, Duncan Murdoch wrote: On 09/02/2009 5:07 PM, Fuchs Ira wrote: I would like to have a function which gets data, does a calculation and prints a result and then waits some number

Re: [R] pause in function execution

2009-02-09 Thread Duncan Murdoch
On 09/02/2009 5:07 PM, Fuchs Ira wrote: I would like to have a function which gets data, does a calculation and prints a result and then waits some number of seconds and repeats. If I use Sys.sleep, the execution is pausing but the function output is buffered so that it all comes out when t

Re: [R] pause in function execution

2009-02-09 Thread andrew
I am not too sure what your question is, but try ?debug or take a look at http://www.ats.ucla.edu/stat/r/library/R-debug-tools.pdf On Feb 10, 9:07 am, Fuchs Ira wrote: > I would like to have a function which gets data, does a calculation   > and prints a result and then waits some number of sec

[R] pause in function execution

2009-02-09 Thread Fuchs Ira
I would like to have a function which gets data, does a calculation and prints a result and then waits some number of seconds and repeats. If I use Sys.sleep, the execution is pausing but the function output is buffered so that it all comes out when the function terminates. How can I get