0

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.

Steven Beaupré
  • 21,343
  • 7
  • 57
  • 77
msbmunees
  • 1
  • 1
  • 2

1 Answers1

1

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]")
Will
  • 1,078
  • 1
  • 8
  • 8
  • Thanks, As of now I did not use the library() in the code but used it in the console every time I run that code. A temporary fix. – msbmunees May 16 '15 at 15:29
  • 1
    I had a similar problem, I detached arules and arulesSequences and only loaded arulesSequences, then the error was gone. Something similar happened with shiny and shinyFiles. I think it might be a problem if a library loads another already loaded library and does not do it correctly. – Verena Haunschmid Oct 21 '15 at 06:56