Learn R Programming

Xmisc (version 0.1.0)

raw_input: Input from the terminal (in interactive use)

Description

Input from the terminal (in interactive use), confined by choice if provided.

Usage

raw_input(msg = "", choice, strip = TRUE)

Arguments

msg
character, a message to input
choice
character, choices to confine the input
strip
logical, whether to strip trailing spaces of the input

Value

  • character

Examples

Run this code
raw_input("Please enter user name: ")
raw_input("Please confirm",choice=c("yes","no"))

Run the code above in your browser using DataLab