Another solution requiring also a bit of programming is:
l<-letters[1:3] c2<-c() for(i in 1:3){c2<-c(c2,paste(letters[i],letters[i:3],sep=""))} c2 [1] "aa" "ab" "ac" "bb" "bc" "cc" n<-length(c2) c3<-c();for(i in 1:n){c3<-c(c3,paste(c2[i],letters[ceiling(i/2):3],sep=""))} c3 [1] "aaa" "aab" "aac" "aba" "abb" "abc" "acb" "acc" "bbb" "bbc" "bcc" "ccc" ______________________________________________ R-help@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.