Reputation: 16697
I'm working on functions which catches input variables and preprocess them before evaluation.
I would like to ignore RStudio warning (yellow triangle) with tooltip message missing argument to function call
.
Below code is detected by RStudio as warning which in my use case is not a warning.
f = function(a, b) match.call()
f(a = list("a","b",,"d",,,"g",), b = list(,,"c"))
Missing argument is valid use case.
Can I somehow set to ignore this type of warning?
Upvotes: 1
Views: 956
Reputation: 1148
You can use options
to turn all warnings off. The argument is showWarnCalls
and is a boolean. Use as such:
options(showWarnCalls = FALSE)
Please note this is dangerous as this turns off all of your warnings. Perhaps you could turn warnings off before running the function that commits them and then turn them back on afterward. Example:
options(showWarnCalls = FALSE)
### Your Code ###
options(showWarnCalls = TRUE)
Upvotes: 1