[R] eliminating a large subset of data from a frame

Peter Whiting pete at sprint.net
Fri Sep 5 17:50:44 CEST 2003


I have a data frame with 155,000 rows. One of the columns
represents the user id (of which about 10,000 are unique).  I am
able to isolate 1000 of these user ids (stored in a list) that
I want to eliminate from the data set, but I don't know of an
efficient way to do this. Certainly this would be slow:

newdf<-df
for(i in listofbadusers) {
 newdf<-subset(tmp,uid!=i)
}

is there a better approach?

I guess I could use the opposite logic and use a list of
good users and add their data to the new frame...

thanks,
pete




More information about the R-help mailing list