Bert, this is not helpful. Since for loops and apply functions are not vectorized, why are you admonishing Carl that vectorizing doesn't always speed up algorithms? He didn't reference apply functions as being vectorized. But you seem to be doing so.

I would assert that vectorizing DOES always speed up algorithms, but things people sometimes think are vectorizing are not really.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Bert Gunter <gunter.berton@gene.com> wrote:

Carl: "Almost anything you can do in a for() loop can be done easier and
faster with vectorization.-- "

That is false: while this is certainly true for a great many basic
vectorized operations, it is certainly false for most other things --
simulations are a typical example. Note that __ply type operations in base
R, plyr , and other packages are (generally) _not_vectorized; they are
"disguised" loops. Explicit for() loops are often just as fast or even a
bit faster, though many of us prefer what we consider the more transparent
functional style code of the __ply's.

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

	[[alternative HTML version deleted]]

_____________________________________________

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.


	[[alternative HTML version deleted]]

