50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

installr (version 0.8)

ask.user.yn.question: Asks the user for one yes/no question.

Description

Asks the user for one yes/no question. If the users replies with a "yes" (or Y, or y) the function returns TRUE. Otherwise, FALSE. (also exists as the function devtools::yesno)

Usage

ask.user.yn.question(question, yn_text = "(y/n):",
    add_lines_before = T)

Arguments

question
a character string with a question to the user.
yn_text
the y/n text after the question.
add_lines_before
if to add a line before asking the question. Default is TRUE.

Value

  • TRUE/FALSE - if the user answeres yes or no.

Examples

Run this code
ask.user.yn.question("Do you love R?")

Run the code above in your browser using DataLab