[R] Select certain elements from dataframe

From: SebastianEck <sebastianeck_at_web.de>
Date: Mon, 19 May 2008 02:20:14 -0700 (PDT)


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

  [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 :)


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_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 19 May 2008 - 10:12:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 19 May 2008 - 10:30:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive