Re: [R] Pause in non-interactive mode

2010-02-05 Thread Jonne Zutt
Thank you very much, works perfectly! I understand why as well now (thank you too Duncan ;)) I have been away from this mailinglist for a while, but I'm happy to see that you are both still this active :) Sorry for forgetting to mention my R version, it was $ rpm -q R R-2.10.1-1.fc12.i686 Jonne.

Re: [R] Pause in non-interactive mode

2010-02-05 Thread Duncan Murdoch
On 05/02/2010 4:31 AM, Jonne Zutt wrote: Dear all, I've found this nice code fragment on the web (from Jan T. Kim if I'm correct): hitReturn <- function(msg) { invisible(readline(sprintf("%s -- hit return", msg))); } But it does not seem to work in non-interactive mode ( I mean, when I

Re: [R] Pause in non-interactive mode

2010-02-05 Thread Prof Brian Ripley
You have not told us your version of R. In earlier versions of R readline() reads a line from the script (and input buffering affects which line: a number of packages fail their example checks on some platforms because of this). In R-devel it returns "" immediately. To make this work you nee

[R] Pause in non-interactive mode

2010-02-05 Thread Jonne Zutt
Dear all, I've found this nice code fragment on the web (from Jan T. Kim if I'm correct): hitReturn <- function(msg) { invisible(readline(sprintf("%s -- hit return", msg))); } But it does not seem to work in non-interactive mode ( I mean, when I start a script like this: R --vanilla < sc