askYesNo
Ask a Yes/No Question

Description

Asks a yes/no question. Returns TRUE for yes, FALSE for no, and NA if the operation is cancelled.

Usage

askYesNo(msg, default = TRUE,
    prompts = getOption("askYesNo", gettext(c("Yes", "No", "Cancel"))), ...)

Arguments

msg a character string. The message being asked. Required.
default the default value if no response is provided.
prompts the allowed response values. These values are partially matched and the case is ignored.
... currently ignored.

Details

The values of prompts are displayed after the msg, with the default value of the prompt starting with upper-case characters. The other prompt values are shown in lower case.
Value
returns a logical value or NA, depending on the response entered.
Examples
## Not run: 
a <- askYesNo("Select one")
b <- askYesNo("Select one", default=FALSE)  # FALSE if no response is entered

## End(Not run)
Package utils version 6.1.1-7
Package Index