在导入中排除函数 - 命名空间

时间:2016-06-27 06:21:03

标签: r namespaces

我的问题是,在我的导入中,有两个包具有名为alpha的函数,但在我的代码中,我只使用包ggplot2中的包(另一个包是psychometric)。检查后我得到了这个警告:

  

警告:在加载'mypackage'时,用'psychometric :: alpha'替换以前的导入

描述文件:

Imports: deltaPlotR, difNLR, difR, foreign, ggplot2, gridExtra, ltm, moments, nnet, psychometric, reshape2, shiny, shinyAce

命名空间文件:

import(shiny,
       shinyAce,
       moments,
       foreign,
       nnet,
       ggplot2,
       reshape2,
       ltm,
       psychometric,
       difR,
       deltaPlotR,
       gridExtra,
       difNLR)

虽然我使用了两个包中的很多功能(ggplot2psychometric) 我尝试使用import(psychometric, exclude = alpha)但是我收到了错误:

  

ERROR
  不需要命名空间依赖:'alpha'

1 个答案:

答案 0 :(得分:1)

我们可以显式调用函数,而不是更改命名空间和导入:

ggplot2::alpha()
相关问题