锁定包名称空间

时间:2014-07-30 15:43:46

标签: r namespaces package

我正在使用" BMA" R 3.1.0中的软件包,运行软件包iBMA.glm中的一个函数时出错。在包文档中运行示例时:

## Not run:
############ iBMA.glm
library("MASS")
library("BMA")
data(birthwt)
y<- birthwt$lo
x<- data.frame(birthwt[,-1])
x$race<- as.factor(x$race)
x$ht<- (x$ht>=1)+0
x<- x[,-9]
x$smoke <- as.factor(x$smoke)
x$ptl<- as.factor(x$ptl)
x$ht <- as.factor(x$ht)
x$ui <- as.factor(x$ui)
### add 41 columns of noise
noise<- matrix(rnorm(41*nrow(x)), ncol=41)
colnames(noise)<- paste('noise', 1:41, sep='')
x<- cbind(x, noise)
iBMA.glm.out<- iBMA.glm( x, y, glm.family="binomial",
factor.type=FALSE, verbose = TRUE,
thresProbne0 = 5 )
summary(iBMA.glm.out)

我收到错误:

Error in registerNames(names, package, ".__global__", add) : 
  The namespace for package "BMA" is locked; no changes in the global variables list may be made.

我在Ubuntu上运行R 3.1.0的RStudio中收到错误。

在Windows 7上,从RStudio和R控制台上我得到了类似的错误:

Error in utils::globalVariables(c("nastyHack_glm.family", "nastyHack_x.df")) : 
  The namespace for package "BMA" is locked; no changes in the global variables list may be made. 

在函数中运行自己的数据时,我也会遇到同样的错误。我不清楚这个错误意味着什么,以及如何解决错误实际上能够使用该功能。任何建议将不胜感激!

0 个答案:

没有答案