[R] Outer, kronecker, etc.
baptiste auguie
ba208 at exeter.ac.uk
Wed Nov 12 21:06:08 CET 2008
you may want to look into Hadley's new package plyr for this kind of
operation.
baptiste
On 12 Nov 2008, at 17:51, Stavros Macrakis wrote:
> By-the-way^2: is there some Xapply function that maps a function over
> all the elements of a structure (vector, matrix, list, ...) and
> preserves the original structure? For example, I'd want
> Xapply(matrix(1:4^2,2,2),sqrt) == sqrt(matrix(1:4^2,2,2)). In this
> case, I'd use Xapply(as.character,mm), because as.character returns a
> vector.
_____________________________
Baptiste Auguié
School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK
Phone: +44 1392 264187
http://newton.ex.ac.uk/research/emag
More information about the R-help
mailing list