Hello All, I am facing a problem and am unable to find much help online as sets package in R is relatively new. My problem is as follows:
Set R is made of 2 sets x and y x<-{"P1", "P2", "P3", "P4"} y<-{} R<-set(x,y) #R={{}, {"P1", "P2", "P3", "P4"}} i need to use R in a recursive loop where i need to take set difference of R and it 's elements. Example: for (r in R){ print(r) R<-set_symdiff(r,R) print(R) } the program is unable to recognise the null set in the set R. I tried various funtions and methods: > R-r #Output : {{}, {"P1", "P2", "P3", "P4"}} > set_symdiff(r,R) Output: {{}, {"P1", "P2", "P3", "P4"}} > set_symdiff(R,r) Output: {{}, {"P1", "P2", "P3", "P4"}} i also tried with set_complement() .But they do not subtract the null set from the bigger set. It seems they dont recognise it. What can I try, any pointers/ packages will be great help. Please help . Thanks, Neha [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.