【发布时间】:2017-07-06 05:16:18
【问题描述】:
我搜索了一下,发现如果我使用suppressPackageStartupMessages(),我应该能够解决我的问题,但事实证明,什么也没发生。
我正在像这样加载我的包:
if (!require("gplots", quietly = T)) {
sink("/dev/null")
suppressPackageStartupMessages(suppressWarnings(suppressMessages(install.packages("gplots"))))
suppressPackageStartupMessages(suppressWarnings(suppressMessages(library("gplots", quietly = T))))
}
当我的脚本运行时,我会收到以下消息:
Attaching package: ‘gplots’
The following object is masked from ‘package:IRanges’:
space
The following object is masked from ‘package:S4Vectors’:
space
The following object is masked from ‘package:stats’:
lowess
在另一个包裹上,
if (!require("Rmixmod", quietly = T)){
sink("/dev/null")
suppressPackageStartupMessages(suppressWarnings(suppressMessages(install.packages("R_packages/Rmixmod_2.0.1.tar.gz", type="source"))))
}
我还在加载时获得了引用选项,并且我也在尝试将其静音。
Rmixmod version 2.0.1 loaded
R package of mixmodLib version 3.0.1
Condition of use
----------------
Copyright (C) MIXMOD Team - 2001-2013
MIXMOD is publicly available under the GPL license (see www.gnu.org/copyleft/gpl.html)
You can redistribute it and/or modify it under the terms of the GPL-3 license.
Please understand that there may still be bugs and errors. Use it at your own risk.
We take no responsibility for any errors or omissions in this package or for any misfortune that may befall you or others as a result of its use.
Please report bugs at: http://www.mixmod.org/article.php3?id_article=23
More information on : www.mixmod.org
Package 'mclust' version 5.2.1
Type 'citation("mclust")' for citing this R package in publications.
如何做到这一点?
【问题讨论】:
-
@BigDataScientist 我发现了那个帖子,正如你所看到的,我正在使用他们的建议。但它没有工作
-
他建议只使用
suppressMessages(library...),这对我有用 -
@BigDataScientist 我试过了。没有运气
-
好吧奇怪,然后我不标记为重复,但不能帮助 sry,因为我无法复制错误。祝你好运!
标签: r