I am trying to find all the unique groupings of a list of items. Below is the code:
x <- c("Dominion","progress","scarolina","tampa","tva","TminKTYS","TmaxKTYS","TminKBNA","TmaxKBNA", "TminKMEM","TmaxKMEM","TminKCRW","TmaxKCRW","TminKROA","TmaxKROA","TminKCLT","TmaxKCLT","TminKCHS" ,"TmaxKCHS","TminKATL","TmaxKATL","TminKCMH","TmaxKCMH","TminKJAX","TmaxKJAX","TminKLTH","TmaxKLTH" ,"TminKMCO","TmaxKMCO","TminKMIA","TmaxKMIA","TminKPTA","TmaxKTPA","TminKPNS","TmaxKPNS","TminKLEX" ,"TmaxKLEX","TminKSDF","TmaxKSDF") zz <- sapply(seq_along(x), function(y) combn(x,y)) #Generates a list with of the combinations sapply(zz, function(z) t(unique(t(z)))) #Filter out all the duplicates
However, the code causes my memory to run out of memory. Is there a better way to do this? I understand that I have a long list. thanks.