[R] Accessing row names

From: Werner Wernersen <pensterfuzzer_at_yahoo.de>
Date: Fri 03 Feb 2006 - 22:55:48 EST


  I am doing cluster analysis and get back the vector with the clusters. Now I want to access the original data according to the assigned clusters. Therefore, I need the row names of the $cluster vector. Right now I do the following what works but seems a little awkward:   dat[rownames(as.data.frame(which(kcl$cluster==1))),]   Is there maybe a better or "correct" way to do this?   

  Thanks a lot!

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Feb 03 23:06:53 2006

This archive was generated by hypermail 2.1.8 : Sat 04 Feb 2006 - 03:24:57 EST