questdlg {matlab2r} | R Documentation |
Prompt for multiple-choice
Description
This function aims to loosely mimic the behavior of the questdlg function on Matlab
Usage
questdlg(
quest,
dlgtitle = "",
btn = c("y", "n"),
defbtn = "n",
accepted_ans = c("y", "yes", "n", "no")
)
Arguments
quest |
Question |
dlgtitle |
Title of question |
btn |
Vector of alternatives |
defbtn |
Scalar with the name of the default option |
accepted_ans |
Vector containing accepted answers |
Value
Whatever is entered by the user after the prompt created by the function.
Examples
## Not run:
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")
}
## End(Not run)
[Package matlab2r version 1.5.0 Index]