[R] matrix: rows to columns conversion

Jonathan Baron baron at cattell.psych.upenn.edu
Mon Jul 8 16:18:31 CEST 2002


On 07/08/02 15:48, Rado Bonk wrote:
>I'm new to "R". I have a matrix of 6x12. I need to produce matrix of
>12x6, such that rows in new matrix are columns from original matrix, and
>columns in a new matrix are rows from the original one. I was playing
>with rbind(), and cbind() with no success.

You want t()

And, at this stage of learning, you might also find a reference
card useful.  See my R page.

-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
R page:               http://finzi.psych.upenn.edu/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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 mailing list