Re: [R] data.frame indexing

From: Philipp Pagel <p.pagel_at_wzw.tum.de>
Date: Mon, 28 Apr 2008 17:03:35 +0200

> > 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
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany
 
 and
 
Institut für Bioinformatik und Systembiologie / MIPS
Helmholtz Zentrum München -
Deutsches Forschungszentrum für Gesundheit und Umwelt
Ingolstädter Landstrasse 1
85764 Neuherberg, Germany
http://mips.gsf.de/staff/pagel

______________________________________________
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 - 16:23: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 - 17:30:32 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