[Rd] RFC: sapply() limitation from vector to matrix, but not further
hadley at rice.edu
Wed Dec 1 19:51:54 CET 2010
> A downside of that approach is that lapply(X,...) can
> cause a lot of unneeded memory to be allocated (length(X)
> SEXP's). Those SEXP's would be tossed out by simplify() but
> the peak memory usage would remain high. sapply() can
> be written to avoid the intermediate list structure.
But the upside is reusable code that can be used in multiple places -
what about the simplification code used by mapply and tapply? Why are
there three different implementations of simplification?
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
More information about the R-devel