issue_warning | R Documentation |
This allows us to control the messages emitted and continue to keep CLI as a suggested package.
issue_warning(
msg = NULL,
cli = has_cli(),
what = NULL,
url = NULL,
n = NULL,
N = NULL,
infos = list(),
reports = list(),
...
)
pb_message(..., domain = NULL, appendLF = TRUE)
line_report(msg = "", path, pos, sep = "\t", type = "warning")
append_labels(l, i = TRUE, e = "", cli = FALSE, f = "style_inverse")
message_muffler(expr, keep = FALSE)
msg |
the message as a glue or CLI string. Defaults to NULL |
cli |
if |
what |
the name of the specific element to report in an error |
url |
a url for extra information to help. |
n |
the number of elements errored |
N |
the number total elements |
infos |
the information about the errors to be shown to the user |
reports |
the reported errors. |
... |
named arguments to be evaluated in the message via glue or CLI |
domain |
see |
appendLF |
logical: should messages given as a character string have a newline appended? |
path |
path to the file to report |
pos |
position of the error |
sep |
a character to use to separate the human message and the line number |
type |
(used in the context of CI only) the type of warning that should be thrown (defaults to warning) |
l |
a vector/list of characters |
i |
the index of elements to append |
e |
the new element to append to each element |
f |
a function from cli that will transform |
expr |
an R expression. |
keep |
if |
The vast majority of the code in this function is copied directly from the
message()
function.
nothing, invisibly; used for side-effect
, l
, appended
if keep = FALSE
, the output of expr
, if keep = TRUE
, a list
with the elements val = expr
and msg = <cliMessage>s
pegboard:::pb_message("hello")
x <- letters[1:5]
x2 <- pegboard:::append_labels(x,
c(1, 3),
"appended",
cli = requireNamespace("cli", quietly = TRUE),
f = "col_cyan"
)
writeLines(glue::glue("[{x}]->[{x2}]"))
pegboard:::message_muffler({
cli::cli_text("hello there! I'm staying in!")
pegboard:::pb_message("normal looking message that's not getting through")
message("this message makes it out!")
runif(1)
})
pegboard:::message_muffler({
cli::cli_text("hello there! I'm staying in!")
pegboard:::pb_message("normal looking message that's not getting through")
message("this message makes it out!")
runif(1)
}, keep = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.