askUser {mmstat4}R Documentation

askUser

Description

askUser provides a way to ask the user a yes/no/cancel question (default). A * after a number indicates the default option.

Usage

askUser(
  msg,
  choices = c("Yes", "No", "Cancel"),
  default = 1,
  col = crayon::black
)

Arguments

msg

character: the prompt message for the user

choices

character: vector of choices (default: c("Yes", "No", "Cancel"))

default

character/integer: default option if only Enter pressed (default: 1)

col

function: a color function (default: crayon::black)

Value

the integer number choosen by the user

Examples

if (interactive())
  askUser("Do you want to use askUser?")

[Package mmstat4 version 0.2.1 Index]