[R] Getting user input without hitting enter
kohleth at gmail.com
Wed Nov 24 13:53:00 CET 2010
I am writing a function which requires user to enter a single character. Something like:
if(input=="h")cat("Hello") # What goes after the 'if' is completely arbitrary, for simplicity sake I simply put a cat command here.
I want R to automatically finish scanning after the user has entered the 1st character, without hitting 'enter'.
How do I do this?
More information about the R-help