This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/readline.html
readline {base}R Documentation

Read a Line from the Terminal

Description

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

Usage

readline()

Examples

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

[Package base version 0.60 ]