[R] Select certain elements from dataframe

SebastianEck sebastianeck at web.de
Mon May 19 11:20:14 CEST 2008


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.



More information about the R-help mailing list