Hi, sd_all_clusterX<-sd_all[(as.character(clusterX)%in%as.character(sd_all$X)),] again selects everything from sd_all, whereas
sd_all_clusterX<-sd_all[(as.character(sd_all$X)%in%as.character(ClusterX)),] results in sd_all_clusterX having 681 entries, what is smaller than the whole dataset (707 entries) but much larger than the actual 127 clusterelements I want to select. Tank you that you are trying to solve the problem, and sorry for the trouble, I included a sample for my data now: Cluster: http://www.nabble.com/file/p17338101/clusterX clusterX sd_all_sample: http://www.nabble.com/file/p17338101/sd_all_sample sd_all_sample Again thank you for your help, Sebastian -- View this message in context: http://www.nabble.com/Select-certain-elements-from-dataframe-tp17314209p17338101.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.