avoiding too many loops - reshaping data
Beware of facile comparisons of this sort -- they may be apples and nematodes.
And they also imply that the main time sink is the computation. In my experience, figuring out how to solve the problem using takes considerably more time than 18 / 1000 seconds, and so investing your energy in learning idioms that apply in a wide range of situations is far more useful than figuring out the fastest solution to a single problem. Hadley
Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/