简体   繁体   中英

CSPADE method in R throws ERROR: no slot of name “transactionInfo” for this object of class “transactions”

I get error in R when running the following method for CSPADE algorithm (finding association rules in transactions):

x <- read_baskets(con = system.file("misc", "zaki.txt", package = "arulesSequences"), info = c("sequenceID","eventID","SIZE"))

s1 <- cspade(x, parameter = list(support = 0.4), control = list(verbose = TRUE))
parameter specification:
support : 0.4
maxsize :  10
maxlen  :  10

algorithmic control:
bfstype  : FALSE
verbose  :  TRUE
summary  : FALSE
tidLists : FALSE

preprocessing ...
Error in typeof(x) : 
  no slot of name "transactionInfo" for this object of class "transactions"

"x" is a transaction object and it gets successfully created but for some reason the cspade method does not work (even on its classic data set which is provided in its documentation)

Probably too late but for next readers, I think this bug appeared after an upgrade of the package.

Just add :

attributes(x)$transactionInfo <- x@itemsetInfo

after creating x with read_baskets()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM