Generates a warning message that corresponds to its argument(s) and (optionally) the expression or function from which it was called.
warning(…, call. = TRUE, immediate. = FALSE, noBreaks. = FALSE,
domain = NULL)
suppressWarnings(expr)
| Parameter | Description |
|---|---|
… |
zero or more objects which can be coerced to character (and which are pasted together with no separator) or a single condition object. |
call. |
logical, indicating if the call should become part of the warning message. |
immediate. |
logical, indicating if the call should be output immediately, even if getOption("warn") <= 0. |
noBreaks. |
logical, indicating as far as possible the message should be output as a single line when options(warn = 1). |
expr |
expression to evaluate. |
domain |
see gettext. If NA, messages will not be translated, see also the note in stop. |
# NOT RUN {
testit <- function() warning("testit")
testit() ## shows call
testit <- function() warning("problem in testit", call. = FALSE)
testit() ## no call
suppressWarnings(warning("testit"))
# }