当我需要一个库时,我不希望它附带所有额外的输出。我怎么能关掉这个?
有输出(坏):
> require('forecast')
Loading required package: forecast
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
Loading required package: timeDate
This is forecast 5.4
>
没有输出(好):
> require('forecast')
>
答案 0 :(得分:3)
您可以使用require
包裹library
(和/或suppressMessages
),
suppressMessages(require(forecast))
并且加载时不会显示消息。