[R] How do I tell whether two vectors are identical?

Łukasz Ręcławowicz lukasz.reclawowicz at gmail.com
Tue Oct 12 23:11:06 CEST 2010


Let's test speed in this way:

> benchmark(isTRUE(all.equal.numeric(x,y)),replications=1e3)
                                  replications elapsed relative
user.self sys.self
                                            1000   34.01        1
29.09     0.16
> benchmark(differences<-compare$id[compare$x!=compare$y],replications=1e3)
                                  replications elapsed relative
user.self sys.self
                                            1000    4.33        1
   4        0

2010/10/12 David Winsemius <dwinsemius at comcast.net>:
> The method of embedding in a dataframe is going to be really slow.


-- 
Miłego dnia



More information about the R-help mailing list