Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid class “itemMatrix” object: item labels not unique #6

Open
kliegr opened this issue Sep 4, 2019 · 1 comment
Open

invalid class “itemMatrix” object: item labels not unique #6

kliegr opened this issue Sep 4, 2019 · 1 comment

Comments

@kliegr
Copy link

kliegr commented Sep 4, 2019

It looks like that the frameToRules function sometimes returns error "invalid class “itemMatrix” object: item labels not unique"
Some debugging showed that

unique(unlist(sapply(rowItems, function(x) x$ant)))

does not filter out repeating items.
A fix seems to be replacing this with

unique(c(unlist(sapply(rowItems, function(x) x$ant))))

That is

antItems <- unique(c(unlist(sapply(rowItems, function(x) x$ant))))
consItems <- unique(c(unlist(sapply(rowItems, function(x) x$cons))))
@HanselPalencia
Copy link

Where are we on this fix? I am currently getting this error, and would benefit from a solution. I tried taking the source code of the function and replacing the section that you talked about it in your post, but it did not work.

I also attempted,

unique(mydatset) 

to see if all rows were unique and they were.

Any insight?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants