问题描述
我是R的新手,正在尝试安装gdata
软件包,以便可以使用excel文件.当我尝试加载程序包时,收到以下消息:
I'm a newbie to R and am trying to install the gdata
package so that I can work with excel files. When I tried to load the package, I received the following message:
> library(gdata)
gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.
gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.
Attaching package: ‘gdata’
The following object is masked from ‘package:stats’:
nobs
The following object is masked from ‘package:utils’:
object.size
我不确定,是否应该关注最后两行.据我从其他帖子中了解到,它们是我输入的某些R函数可能会被覆盖的通知.在gdata
中,反之亦然,具体取决于我的设置.但是我在任何地方的屏幕上都看不到gdata
的痕迹(例如,当我加载JGR时,控制台中会弹出一个新窗口).一切看上去与我加载gdata
之前相同. 能否请您确认是否表示我已成功加载gdata
?
I'm not sure, if I should be concerned about the last two lines. As far as I understood from other posts, they are a notice that some R functions I type in may be overridden in gdata
, and vice-versa depending on my settings. But I see no trace of gdata
on my screen anywhere (for example when I load JGR a new window pops up in my console). Everything looks the same as before I had loaded gdata
. Can you please confirm if that means I have successfully loaded gdata
?
推荐答案
看看
print(.packages())
如果其中包含"gdata",则说明软件包已成功加载.我怀疑该软件包已加载,因为您收到了屏蔽警告消息.
If "gdata" is inside, then the package is successfully loaded. I suspect the package has been loaded, because you got the warning message for masking.
您不必担心掩盖.您始终可以在不同的程序包中执行gdata::nobs
和stats::nobs
来调用nobs
函数.同样,您始终可以执行gdata::object.size
和utils::object.size
以获得正确的功能.
You don't need to worry too much about masking. You can always do gdata::nobs
and stats::nobs
to call nobs
function in different packages. Similarly, you can always do gdata::object.size
and utils::object.size
to get the right function.
这篇关于gdata-“对象被遮罩..."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!