Skip to content
Prev 38603 / 63424 Next

Wait for user input with readline()

On Mon, Dec 06, 2010 at 08:25:39AM -0800, Alexandre wrote:
How do you call your code? Function readline() does not wait for
user input in a non-interactive session, for example R CMD BATCH
or Rscript.

Another situation, when readline() does not wait is, when you copy
a block of code and paste it to a running session, even if it is
interactive. If readline() is not the last line of the code, then
the next line of code is used instead of the user input.

Petr Savicky.