This function is an improved version of userQuery
from Bioconductor Biobase
package, which asks the user about some task that needs her intervention to proceed,
e.g., ask if one should perform a computation, install a package, etc..
askUser(
msg,
allowed = c("y", "n"),
idefault = "n",
default = "n",
case.sensitive = FALSE
)
the character string typed/agreed by the user or directly the default answer in non-interactive mode.
The output message
Allowed input from the user
default response in interactive mode. This answer will be in upper case in the question and will be the one returned if the user simply hits return.
default response in non-interactive mode.
If NA
, then the user is forced to provide an answer, even in non-interactive mode
(e.g., when run through Rscript
).
Is the response case sensitive? Defaults to
FALSE