Skip to content

withOptions suppresses warnings #124

@markmfredrickson

Description

@markmfredrickson

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))
> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions