Reputation: 8435
I need to supress output from an R function -- I have found a hack, but it feels like the wrong way to do it.
Right now, i'm combining invisible
and capture.output
-- which is effective, but it feels very hacky to chain together two similar tools to supress the output.
The function's output I need to supress is blpConnect
from the Rbbg
package.
require(Rbbg)
invisible(capture.output(conn <- blpConnect()))
For those that are interested, invisible
returns the following:
> conn <- invisible(blpConnect())
R version 3.0.1 (2013-05-16)
rJava Version 0.9-4
Rbbg Version 0.4-155
Java environment initialized successfully.
Looking for most recent blpapi3.jar file...
Adding C:\blp\API\APIv3\JavaAPI\v3.4.8.1\lib\blpapi3.jar to Java classpath
Bloomberg API Version 3.4.8.1
Same output for invisible(conn <- blpConnect())
What's the appropriate way to do this?
Enlightening commentary on the appropriate use of the two commands, and when and why they work as they do would be valuable.
Upvotes: 2
Views: 209