可能重复:
R 从依赖项中抑制启动消息
我已经阅读了有关使用sink("NUL")
/sink("/dev/null")
的信息,但它们都没有解决我遇到的问题。即使我将library()
命令包装在sink("NUL")
and中sink()
,我对 Rscript 的调用也会输出我不想看到的各种信息:
Loading required package: Matrix
Loading required package: methods
Loading required package: lattice
Loaded glmnet 1.8
Loading required package: MASS
Loading required package: lme4
Attaching package: 'lme4'
The following object(s) are masked from 'package:stats':
AIC, BIC
Loading required package: R2WinBUGS
Loading required package: coda
Attaching package: 'coda'
The following object(s) are masked from 'package:lme4':
HPDinterval
Loading required package: abind
Loading required package: foreign
arm (Version 1.5-05, built: 2012-6-6)
Working directory is C:/Users/andrews/bootstraps/user/_branches/ER-PoC/Bootstraps/R
Attaching package: 'arm'
The following object(s) are masked from 'package:coda':
traceplot
[1] "client=51" "date='01-01-2011'"
[1] "01-01-2011"
[1] 51
最后的东西是我真正想要的唯一输出,也是我似乎能够用sink()
命令抑制的唯一输出。似乎真的应该有一个参数来抑制这个输出(如果我的脚本在控制台中Rscript
,它甚至不会出现)......任何输入?source