

   readline {base}                              R Documentation

   RReeaadd aa LLiinnee ffrroomm tthhee TTeerrmmiinnaall

   DDeessccrriippttiioonn::

        `readline' reads a line from the terminal, returning it
        as a character string.

   UUssaaggee::

        readline(prompt="")

   AArrgguummeennttss::

     prompt: the string printed when prompting the user for
             input.  Should usually end with a space `" "'.

   EExxaammpplleess::

        fun <- function() {
          ANSWER <- readline("Are you a satisfied R user? ")
          if (substr(ANSWER, 1, 1) == "n")
            cat("This is impossible.  YOU LIED!\n")
          else
            cat("I knew it.\n")
        }
        fun()

