onetime-rlang {onetime} | R Documentation |
Print a warning or message only once using rlang
functions
Description
If you use these you will need to add "rlang"
to your package dependencies.
Usage
onetime_rlang_warn(
...,
id = deprecate_calling_package(),
path = default_lockfile_dir(),
expiry = NULL,
without_permission = "warn"
)
onetime_rlang_inform(
...,
id = deprecate_calling_package(),
path = default_lockfile_dir(),
expiry = NULL,
without_permission = "warn"
)
Arguments
... |
Passed to |
id |
Unique ID string. If this is unset, the name of the calling
package will be used. Since onetime 0.2.0, not setting |
path |
Directory to store lockfiles. The default uses a unique
directory corresponding to the calling package, beneath
|
expiry |
|
without_permission |
Character string. What to do if the user hasn't
given permission to store files? |
Value
Invisibly: TRUE
if the message/warning was shown, FALSE
otherwise.
Examples
oo <- options(onetime.dir = tempdir(check = TRUE))
id <- sample(10000L, 1)
for (n in 1:3) {
onetime_rlang_warn(c("rlang-style warning", i = "Extra info"), id = id)
}
onetime_reset(id = id)
options(oo)