[R] Help regarding arules package

From: Daniel Wagner <danieljm1976_at_yahoo.com>
Date: Wed, 16 Jul 2008 08:56:30 -0700 (PDT)


Dear R experts,
 
I need help to make my little program efficient which now takes 2hrs to complete.  
Using arules package I developed set of rules consisted of 900 rules. Now I want to check whether a lower rule is a subset of a higher premises rule. And if it is a subset of higher premises rule then drop this rule. I am using following code but it takes too much time.  
  
nor<-length(rules)
k<-rep(T, nor)
for(i in 1:(nor-1)){

      for(j in (i+1):nor){
         if((is.subset(lhs(rules[i]),lhs(rules[j])) & is.subset(rhs(rules[i]), rhs(rules[j])))==T){
            k[i]<-F
            break
         }
     }

}
 
Could somebody help me.
 
Thanks
 
Daniel
Amsterdam
 

Send instant messages to your online friends http://uk.messenger.yahoo.com

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 16 Jul 2008 - 16:01:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jul 2008 - 03:32:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive