> I would think that when translating from another language, > it is best to write it in R in the simplest way, which probably > means using a list. Then if it turns out to be too slow, try doing > something fancy. I suspect that speed improvements are > seldom necessary -- I can't believe how fast most computations > are these days.
I totally agree. However, if you are implementing an algorithm that is O(n^2) when using a hash table that has O(1) updates, it is likely to be at least O(n^3) when using a list with O(n) updates. And sometimes speed does matter! (Although not as often as most people think, and, of course, beware premature optimisation.) Hadley ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
