Learn R Programming

mmstat4 (version 0.2.0)

askUser: askUser

Description

askUser provides a way to ask the user a yes/no/cancel question (default). A * after a number indicates the default option.

Usage

askUser(msg, choices = c("Yes", "No", "Cancel"), default = 1)

Value

the integer number choosen by the user

Arguments

msg

character: the prompt message for the user

choices

character: vector of choices (default: c("Yes", "No", "Cancel"))

default

character/integer: default option if only Enter pressed (default: 1)

Examples

Run this code
if (interactive())
  askUser("Do you want to use askUser?")

Run the code above in your browser using DataLab