Hi, 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. Regards, -Rado -- Radoslav Bonk M.S. Dept. of Physical Geography and Geoecology Faculty of Natural Sciences, Comenius University Mlynska Dolina 842 15, Bratislava tel: 00421 (0)2 602 96 250 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Rado Bonk <rbonk at host.sk> writes:> Hi, > > 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.t() as in transpose... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._