无法在 MacBook 上重现输出,但包可以在 PC 上运行

问题描述

我尝试在 Mac 上从 easi 包中复制代码,但遇到此错误

Error in class(ff) <- "formula" : attempt to set an attribute on NULL

然后我在我的 PC 上运行了相同的脚本并且它起作用了。我需要在 Mac 上进行哪些调整才能使代码正常工作?

这是包创建者提供的示例脚本:

library(devtools)
install_github("cran/easi")
library(easi)
data(hixdata)

#****** Budget Shares Matrix *************
shares_HIX=hixdata[,2:10]
#****** Price Matrix (in logarithms) *****
log.price_HIX=hixdata[,11:19]
#****** Demographic matrix **********
var.soc_HIX=hixdata[,21:25]
#****** Logarithm of total expenditure ***
#****** (here divised by a price index) **
log.exp_HIX=hixdata[,20]
#****** Labels of demographic variables **
labels.soc <- c("age","hsex","carown","time","tran")
#****** Labels of budget shares **********
labels.share=c("food in","food out","rent","operations","furnishing","clothes","transport","recreation")
est <- easi(shares=shares_HIX,log.price=log.price_HIX,var.soc=var.soc_HIX,y.power=5,log.exp=log.exp_HIX,labels.share=labels.share,labels.soc=labels.soc,py.inter=TRUE,zy.inter=TRUE,pz.inter=TRUE,interpz=c(1:ncol(var.soc_HIX)))

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)