powered by
This function aims to loosely mimic the behavior of the questdlg function on Matlab
questdlg( quest, dlgtitle = "", btn = c("y", "n"), defbtn = "n", accepted_ans = c("y", "yes", "n", "no") )
Whatever is entered by the user after the prompt created by the function.
Question
Title of question
Vector of alternatives
Scalar with the name of the default option
Vector containing accepted answers
if (FALSE) { ans <- questdlg("Do you want to continue?", "Continue?") if (tolower(substring(ans, 1, 1)) == "y") { message("You typed yes") } else { message("You didn't type yes") } }
Run the code above in your browser using DataLab