>    In the example I give above, the impact might seem small, but the
> implications are *huge*.  This means that I am, in effect, not allowed to
> use *any* of the vectoring functions in 'R', which avoid performing loops
> thereby speeding up process time extraordinarily.  Many can sympathize that
> 'R' is ridiculously slow with "for" loops, compared to other languages.
>  But that's theoretically OK, a good statistician or data analyst should be
> able to work comfortably with matrices and vectors.

Two comments:

* sapply is generally only _slightly_ faster than a for loop

* it's almost always better to use vapply instead of sapply.

But I agree that simplify2array should be a generic so that you can
write custom methods to support new classes.

Hadley


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
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