alert_utils | R Documentation |
Validate Formatting Argument Values
alert_utils()
.fmt_errs(
st = NULL,
bg = NULL,
fg = NULL,
d = " ",
nullst = TRUE,
nullbg = TRUE,
nullfg = TRUE
)
.ok_fmt(x)
.choose_from(
opts,
mssg,
all,
none,
min,
max,
ft,
fs,
fun,
stack,
clear,
cancel = T
)
st |
Optional style spec. |
bg |
Optional background color spec. |
fg |
Optional foreground color spec. |
d |
Character scalar text delimiter. |
nullst |
Logical scalar indicating whether a |
nullbg |
Logical scalar indicating whether a |
nullfg |
Logical scalar indicating whether a |
opts |
An atomic vector of options to choose from. |
mssg |
Character scalar message to prompt the selection. |
all |
Logical scalar indicating whether it is valid to select all options. |
none |
Logical scalar indicating whether it is valid to select none of the options. |
min |
Non-negative integer scalar minimum number of options to select. |
max |
Positive integer scalar maximum numver of options to select. |
ft |
Character scalar title formatting spec. |
fs |
Character scalar subtitle formatting spec. |
fun |
Character scalar name of calling function. |
stack |
Character vector call stack. |
clear |
Logical scalar indicating whether to clear the console before alerting the user to the selection. |
cancel |
Logical scalar indicating whether cancellation of selection is valid. |
.fmt_errs()
: Validate Formatting Argument Values
.ok_fmt()
: Validate Formatting Argument Values
.choose_from()
: Choose from a List of Options with a Given Message and a Variety of Options
Other console:
console_help()
egOkFmt <- function() {
base::list(blank = uj::.ok_fmt(""),
null = uj::.ok_fmt(NULL),
bad.st = uj::.ok_fmt("q|r|b"),
ok.all = uj::.ok_fmt("y|r|b"),
padded = uj::.ok_fmt(" yellow | red | bold "))
}
egOkFmt()
## Not run:
uj::.fmt_errs(),
uj::.fmt_errs(d = 100),
uj::.fmt_errs(st = "", bg = "", fg = ""),
uj::.fmt_errs(st = "q", bg = "q", fg = "q"),
uj::.fmt_errs(nullst = F, nullbg = F, nullfg = F))
uj::.choose_from(letters, "What letter?", T, N, 0, 26, "b|s|u", "w|b|p", "console", "console", F)
uj::.choose_from(0:9 , "What number?", F, F, 1, 1 , "r|y|b", "y|r|i", "console", "console", T, cancel = F)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.