Matt's suggestion works in Linux (I use Ubuntu and Debian variants), but I 
haven't yet
been able to get it to work in Windows. In a DOS terminal, I can run Cygwin's 
blas.exe via

   blas -c "read -t 1 -n 1"

and get the right functioning, but when embedded in R in various ways, I get 
several error
messages that imply R is not finding or interpreting the command correctly.

As the details are arcane, please contact me off-line, and I'll report back to 
the list
when we have a solution.

However, if someone could try Matt's suggestion on a Mac and let me know 
outcome, that
would be helpful. Since .Platform allows me to determine OS type, I should be 
able to work
out a more or less platform-independent function.

JN

biostatmatt wrote:
> On Thu, 2010-05-27 at 19:08 -0400, Prof. John C Nash wrote:
>> I would like to have a function that would wait either until a specified 
>> timeout (in
>> seconds preferably) or until a key is pressed. 
> .... If you are using Linux
> you can use try this
> 
>> system("read -t 1 -n 1")
> 
> where -n indicates the number of characters to read and -t specifies the
> timeout in seconds.

______________________________________________
R-help@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.

Reply via email to