It isn't entirely clear to me if you want to remove duplicates or expand your matrix. Check ?unique or ?expand.grid. Here are some guesses of what you may want to do.
unique(TimeIndex) expand.grid(as.data.frame(TimeIndex)) expand.grid(as.data.frame(unique(TimeIndex))) TimeIndex2 <- data.frame(time1 = 1:10, label1 = c("Week_of_21_07-29_03", "Thursday_21_03", "Friday_22_03", "Saturday_23_03", "Sunday_24_03", "Monday_25_03", "Tuesday_26_03", "Wednesday_27_03", "Thursday_28_03", "Friday_ 29_03")) expand.grid(unique(TimeIndex2)) Best, Nello -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios Sent: Donnerstag, 21. März 2013 10:23 To: R help Subject: [R] All unique combinations Dear all, I would like to have all unique combinations in the following matrix TimeIndex<- rbind (c(1,"Week_of_21_07-29_03"), c(2,"Thursday_21_03"), c(3,"Friday_22_03"), c(4,"Saturday_23_03"), c(5,"Sunday_24_03"), c(6,"Monday_25_03"), c(7,"Tuesday_26_03"), c(8,"Wednesday_27_03"), c(9,"Thursday_28_03"), c(10,"Friday_ 29_03")) As have a plotting code that takes two input arguments plot_two_time_frames(time1,LabelTime1,time2,LabelTime2) these inputs are time1: integer from TimeIndex. TimeIndex[i,1] LabelTime1: Labels from TimeIndex[i,2] time2: integer from TimeIndex, TimeIndex[i,1] LabelTime2: Labels from TimeIndex[i,2] the times 1 and time 2 should be unique combinations and never the same number. I understand that my explanation was not the best possible. But I would like to thank you in advance for your support Regards Alex [[alternative HTML version deleted]] ______________________________________________ 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.