[R] how convert an array to a matrix?
garbade at psy.uni-muenchen.de
Fri Apr 14 11:57:17 CEST 2000
thanks for your code, it works fine. I´ve calculated the dimnames from
the inidces by simple arithemic.
Peter Dalgaard BSA wrote:
> where slice is the generalised row()/col()/... function which we
> haven't got in R (yet):
> slice<-function(x,i) sweep(x, i, 1:dim(x)[i], function(x,y) y )
> Hmm...that's not quite right. You want the dimnames in there instead
> of 1:dim(x)[i], but you get the general idea.
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help