[R] match function or "=="

Erik Iverson eriki at ccbr.umn.edu
Wed Apr 7 20:58:20 CEST 2010


You might try ?system.time

> Hi all,
> 
> I have a huge dataset(5000k observations), which contains the daily sales
> for each company.
> If I want to find out the a company with unique company id number, which
> function I should use that is more efficient, match or "=="?  For example,
> 
> use<-dataset[!is.na(match(dataset$companyID, 12345)),]
> or
> use<-dataset[dataset$companyID==12345,]
> 
> Thank you very much.
>



More information about the R-help mailing list