How to avoid printing a package's author message? [duplicate]
Possible Duplicate:
Library/package development - message when loading
I want to set up a web interface using Rapache; however, the underlying R code uses packages that display a quick message from the author. E.g., for data.table
,
Quick start guide : vignette("datatable-intro") Homepage : http://datatable.r-forge.r-project.org/
Is there a way to avoid this? I tried suppressMessages()
, and the quietly
option to library()
, but to no avail.
Thanks
For data.table, this was done in commit 233 (2011.06.11 01:04:27) :
"onAttach now uses packageStartupMessage so the banner can be suppressed by those annoyed by banners, whilst still being helpful to new users"
This is in v1.6.1 available from R-Forge, and may be released to CRAN soon.
I'll add a note to NEWS ...
The brute force way of suppressing all output and messages for chatty packages is to use sink:
t <- tempfile()
tcon <- file(t,open="w+")
sink(file=tcon,type='output')
sink(file=tcon,type='message')
require(YOURLIBRARY)
sink(NULL,type='output')
sink(NULL,type='message')
unlink(t)
TAKE THAT YOU CHATTY PACKAGE!
精彩评论