msbmunees
msbmunees

Reputation: 1

R - Error in arules and arulesViz packages

I am using the arules and arulesViz package in R to implement a set of association rules on my data. It worked fine till few days back. But now I am getting the below error whenever I load the R file where I used this package.

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

If I use the plot() function from arulesViz I face this below error:

Error in seq_along(x) : Method length not implemented for class rules

So tried to uninstall the package and reinstalled it. It worked only for the first time after reinstallation, it also threw the below error when I used for the first time after reinstallation.

Loading required package: arules
Loading required package: Matrix

Attaching package: ‘arules’
The following objects are masked from ‘package:base’:
%in%, write

But once I saved the file and loaded it back the old error messages repeated again. I searched in Google but nothing close to this type of error is ever posted by anyone. Your help is appreciated. Thanks.

Upvotes: 0

Views: 3838

Answers (1)

Will
Will

Reputation: 1088

FWIW I got this same error and this SO page is the only Google result that comes up. This fixed it for me (but I don't know why...)

> detach("package:arules", unload=TRUE)
> library("arules", lib.loc="[wherever your R libraries go]")

Upvotes: 1

Related Questions