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 if I take out the elements indexed with b?

The ! operator only works on BOOLEAN.

ONE possible way to set a_notIndexB is:

a_notIndexB <-a [-1*b, ]

--Hans

______________________________________________
R-help@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.

Reply via email to