Re: [R] data.frame indexing

2008-04-28 Thread Philipp Pagel
> > a<-as.data.frame(matrix(rnorm(100),nrow=10,ncol=10)) > > b<-which(a$V1>0.8) > > a_indexb<-a[b,] > > a_notIndexB<-a[!b,] > > nrow(a_notIndexB) > [1] 0 > a_notIndexB <- a[-b,] > nrow(a_notIndexB) [1] 9 cu Philipp -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Tech

Re: [R] data.frame indexing

2008-04-28 Thread Ben Tupper
On Apr 28, 2008, at 10:40 AM, Georg Ehret wrote: 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_notIndex

Re: [R] data.frame indexing

2008-04-28 Thread Hans-Jörg Bibiko
On 28.04.2008, at 16:40, Georg Ehret wrote: 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

[R] data.frame indexing

2008-04-28 Thread Georg Ehret
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