I have noticed that when balanceTest runs and immediately prints, warning messages are suppressed. I have traced this behavior to the use of the finally option to the tryCatch, which we use in withOptions. Brief example:
> f <- function() { warning("Should print")}
>
> f()
Warning message:
In f() : Should print
>
> oldOpts <- options()
>
> tryCatch(f())
Warning message:
In f() : Should print
>
> tryCatch(f(), finally = options(oldOpts))
>
I have noticed that when
balanceTest
runs and immediately prints, warning messages are suppressed. I have traced this behavior to the use of thefinally
option to thetryCatch
, which we use inwithOptions
. Brief example: