我正在使用R中的arules和arulesViz包在我的数据上实现一组关联规则。它工作得很好,直到几天前。但是现在,每当我加载使用这个包的R文件时,我都会得到下面的错误。
Loading required package: arules
Loading required package: Matrix
Attaching package: ‘arules’
The following objects are masked from ‘package:base’:
%in%, write
Error in length(obj) : Method length not implemented for class rules
In addition: Warning message:
package ‘arules’ was built under R version 3.1.3
Error in length(obj) : Method length not implemented for class rules
Error in length(obj) : Method length not implemented for class rules
Error in length(obj) : Method length not implemented for class rules如果我在arulesViz中使用plot()函数,我会遇到以下错误:
Error in seq_along(x) : Method length not implemented for class rules所以我试着卸载包并重新安装它。它只在重新安装后第一次工作,当我在重新安装后第一次使用时,它也抛出了下面的错误。
Loading required package: arules
Loading required package: Matrix
Attaching package: ‘arules’
The following objects are masked from ‘package:base’:
%in%, write但是,一旦我保存了文件并将其加载回来,就会再次重复出现旧的错误消息。我在谷歌上搜索过,但没有任何人发布过这种类型的错误。非常感谢您的帮助。谢谢。
发布于 2015-05-14 09:18:22
FWIW我得到了同样的错误,这个SO页面是唯一出现的Google结果。这为我解决了这个问题(但我不知道为什么…)
> detach("package:arules", unload=TRUE)
> library("arules", lib.loc="[wherever your R libraries go]")https://stackoverflow.com/questions/29854388
复制相似问题