When a call of a function R ships surely signals a warning, by the values of its arguments: always (warning("x")), without any argument (max()), where a name it removes is not bound (rm(x), which only the code running before can tell), or where a value of the formal (one element suffices) is a string R cannot read as a number (as.numeric("a")), a string at all (mean("a")), a finite number outside of the closed range [from, to] (sqrt(-1)), or a whole number of at most wholeAtMost, a pole (gamma(0)). Each entry was checked with R 4.6: a condition only ever holds for values that warn. Under options(warn = 2) R turns each of these warnings into an error.
When a call of a function R ships surely signals a warning, by the values of its arguments: always (
warning("x")), without any argument (max()), where a name it removes is not bound (rm(x), which only the code running before can tell), or where a value of the formal (one element suffices) is a string R cannot read as a number (as.numeric("a")), a string at all (mean("a")), a finite number outside of the closed range[from, to](sqrt(-1)), or a whole number of at mostwholeAtMost, a pole (gamma(0)). Each entry was checked with R 4.6: a condition only ever holds for values that warn. Underoptions(warn = 2)R turns each of these warnings into an error.