Double Colon and Triple Colon Operators
双冒号和三重结肠操作工
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Accessing exported and internal variables in a namespace.
访问出口和内部变量的命名空间中。
用法----------Usage----------
pkg::name
pkg:::name
参数----------Arguments----------
参数:pkg
package name: symbol or literal character string.
包名称:符号或文字字符串。
参数:name
variable name: symbol or literal character string.
变量名:符号或文字字符串。
Details
详情----------Details----------
For a package pkg, pkg::name returns the value of the exported variable name in namespace pkg, whereas pkg:::name returns the value of the internal variable name. The namespace will be loaded if it was not loaded before the call, but the package will not be attached to the search path.
一个包pkg,pkg::name返回的出口变量的值name命名空间中pkg,而pkg:::name返回内部变量的值<X >命名空间将被加载,如果没有被调用之前加载,但包将不被重视的搜索路径。
Specifying a variable or package that does not exist is an error.
指定一个变量或包不存在,是一个错误。
Note that pkg::name does <STRONG>not</STRONG> access the objects in the environment package:pkg (which does not exist until the package's namespace is attached): the latter may contain objects not exported from the namespace. As from R 2.14.0 it can access datasets made available by lazy-loading.
请注意,pkg::name不<STRONG>不会</ strong>访问环境中的对象package:pkg(不存在,直到包的命名空间连接):后者可能包含没有命名空间导出的对象。从R 2.14.0可以访问延迟加载的数据集。
注意----------Note----------
It is typically a design mistake to use ::: in your code since the corresponding object has probably been kept internal for a good reason. Consider contacting the package maintainer if you feel the need to access the object for anything but mere inspection.
它通常是一个设计错误使用:::相应的对象,因为在你的代码可能一直保持一个很好的理由的内部。考虑软件包的维护者联系,如果你觉得需要访问的任何东西,但仅仅检查对象。
参见----------See Also----------
get to access an object masked by another of the same name.
get访问同名的另一个蒙面的对象。
举例----------Examples----------
base::log
base::"+"
## Beware -- use ':::' at your own risk! (see "Details")[#注意 - 使用“:::您自己的风险! (见“详细信息”)]
stats:::coef.default