Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

askUser

User Queries


Description

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..

Usage

askUser(
  msg,
  allowed = c("y", "n"),
  idefault = "n",
  default = "n",
  case.sensitive = FALSE
)

Arguments

msg

The output message

allowed

Allowed input from the user

idefault

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

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).

case.sensitive

Is the response case sensitive? Defaults to FALSE

Value

the character string typed/agreed by the user or directly the default answer in non-interactive mode.


pkgmaker

Development Utilities for R Packages

v0.32.2
GPL (>= 2)
Authors
Renaud Gaujoux [aut, cre]
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.