Skip to content
Prev 273846 / 398506 Next

The "Sets" package and element equality test

No, this is not not the problem, it's really the hashing code which 
makes this fail. If you turn hashing off, then the original match.2.list 
function will work as expected:

 > sets_options("hash", FALSE)
 > match.2.list <- function(l1,l2){
+  length(l1)==length(l2)
+ }
 > s <- set(list(1,2),list(3,4))
 > lset <- cset(s,matchfun = matchfun(match.2.list))
 > lset
{<<list(2)>>}

 > list(1,8) %e% lset
[1] TRUE
Currently, S4 objects are not supported at all as set elements. I will 
have a look on this.

Best
David