Dear all,

apply(X, MARGIN, FUN, ...) returns an array of dimension
c(n, dim(X)[MARGIN]) when FUN returns a vector of length n > 1.

Matrices and arrays are also vectors, so if FUN returns a matrix or an
array, apply returns an array of dimension c(n, dim(X)[MARGIN]) as
above.  This is in accordance with the description of apply in the
Blue Book, and also how Splus works (at least v6.0).

I am curious: why was it decided not to return an array of dimension
c(dim(result.of.FUN), dim(X)[MARGIN]) when FUN returns a matrix or an
array?

(This is not meant as criticism.  I am sure there is a good reason; I
just cannot see it.)

-- 
Bjørn-Helge Mevik

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to