On Oct 12, 2010, at 5:11 PM, Łukasz Ręcławowicz wrote:

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

You are omitting the most time-costly act which is the creation of the "compare" data.frame object. You are also omitting any evaluation of "differences". So your comparison is entirely meaningless. The act of assignment is _not_ the same as turning the differences object into a logical result.



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

And as a result you have chosen not to include the creation of the data.frame inside your loop.



--
Miłego dnia

David Winsemius, MD
West Hartford, CT

______________________________________________
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