'xx1' is a 'factor' and you have to convert to a character before selecting:
data.xx1<-data[ ,as.character(xx1)] On Mon, May 19, 2008 at 5:20 AM, SebastianEck <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a specific problem, I have a large dataframe, and after clustering I > want to select certain colums, the elements of a subcluster. > > My dataframe looks like this : > > > colnames(data) > [1] "101KF4319097339" "102KF4319101170" "103KF4319047549" > "104KF4319046389" > [5] "105KF4319013260" "106KF4319025582" "107KF4319108763" > "108KF4319047040" > [9] "109KF4319060241" "110KF4319056658" "111KF4319036131" > "112KF4319097194" > . > . > . > [701] "821KS4242126913" "822KS4242026026" "823KS4242003122" "824IHT06020" > [705] "825IHT06020" "826IHT06005" "827IHT06005" > > My subcluster looks like this > > > xx1 > xx1 > [1] 101KF4319097339 102KF4319101170 103KF4319047549 104KF4319046389 > [5] 125KF4319063638 126KF4319102180 127KF4319107122 128KF4319019607 > [9] 135KF4319037854 138KF4319050003 140KF4319069150 152KF4319109279 > . > . > . > [125] 795KS4242028634 797KS4242032582 798KS4242035374 > 127 Levels: 101KF4319097339 102KF4319101170 103KF4319047549 ... > 798KS4242035374 > > Now I want to select all elements from data that are in xx1, I tried > > >data.xx1<-data[ ,xx1] > > but that selects the just the first 127 (127 is the number of elements / > length from xx1) elements from data. > > Any help would be very appreciated :) > > Sebastian > -- > View this message in context: > http://www.nabble.com/Select-certain-elements-from-dataframe-tp17314209p17314209.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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? [[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.