Make sure warnings are turned on options(warn=1)
. – Matthew Plourde
How to use `warning()` in an Reference Class method?
-
28-09-2022 - |
Вопрос
warning()
seems to be ignored in reference class methods, although stop()
seems to work. That is,
TestA <- setRefClass("TestA",
methods = list(
warnMe = function() warning("Warn!!!"),
stopMe = function() stop("Stop!!!")
)
)
obj <- TestA()
obj$warnMe()
obj$stopMe()
yields only:
Error in obj$stopMe() : Stop!!!
Is this intentional and if so, why? How am I supposed to raise warnings inside class methods?
Решение
Не связан с StackOverflow