[R] data.frame indexing

From: Georg Ehret <georgehret_at_gmail.com>
Date: Mon, 28 Apr 2008 10:40:12 -0400

Dear R Community, A simple problem (for some of you): I wish to index a data.frame by all elements NOT in my index E.g.:
> a<-as.data.frame(matrix(rnorm(100),nrow=10,ncol=10))
> b<-which(a$V1>0.8)
> b

[1] 1 4 6 10
> a_indexb<-a[b,]
> a_notIndexB<-a[!b,]
> nrow(a_notIndexB)

[1] 0

Indexing a on b is not a problem (a_indexb), but how can do get only the elements left if I take out the elements indexed with b?

Thank you and wishing you a great day!

Georg Ehret
Baltimore, US

        [[alternative HTML version deleted]]

R-help_at_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. Received on Mon 28 Apr 2008 - 15:31:47 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 28 Apr 2008 - 16:30:31 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