ask_question: Ask question in the command line

Description Usage Arguments Value Examples

View source: R/ask_question.R

Description

Ask question in the command line

Usage

1
ask_question(title, answers = c("y", "N"), enterIsValidQuit = TRUE)

Arguments

title

for the question.

answers

the vector for answers for the question. You may include vector elements (answers) as many as possible.

enterIsValidQuit

exits the prompt when an empty answer is provided, e.g. with Enter, with a return value of NULL. Default value for this argument is TRUE.

Value

The selected answer as a character vector. If no answer returned and if enterIsValidQuit is set to TRUE, a NULL is returned.

Examples

1
2
3
4
5
## Not run: 
ask_question("Do you like me?")
ask_question("How much do you like this?", seq(5))

## End(Not run)

strboul/mmy documentation built on Sept. 24, 2021, 12:08 p.m.