只需使用suppressMessages()
在你library()
電話:
[email protected]:~$ R
R version 2.14.1 (2011-12-22)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)
[...]
R> suppressMessages(library(ROCR))
R> # silently loaded
R> search()
[1] ".GlobalEnv" "package:ROCR" # it's really there
[3] "package:gplots" "package:KernSmooth"
[5] "package:grid" "package:caTools"
[7] "package:bitops" "package:gdata"
[9] "package:gtools" "package:stats"
[11] "package:graphics" "package:grDevices"
[13] "package:utils" "package:datasets"
[15] "package:methods" "Autoloads"
[17] "package:base"
R>
正在打印什麼信息? – 2011-12-30 16:42:50
雖然整個輸出是不必要的,但前幾行是:'加載所需包:gplots 加載所需包:gtools 加載所需包:gdata' - 請注意,它不會讓我正確格式化消息。 – learner 2011-12-30 16:52:35
然後在加載'ROCR'之前加載'gplots','gtools'和'gdata'。 – 2011-12-30 16:58:08