[R] transpose a matrix?

From: t c <quantpm_at_yahoo.com>
Date: Wed 21 Dec 2005 - 03:26:45 EST


  I have a data set in the following format:    

  x<-data.frame(id=c(a,b,c),2005-01-15=c(100,225,425), 2005-02-23=c(1100,2325,4525))    

> x

    id X2005.01.15 X2005.02.23

  1  a         100        1100
  2  b         225        2325
  3  c         425        4525
   
   
  I want:
          id

    a
    b
    c
      X2005.01.15
    100
    225
    425
      X2005.02.23
    1100
    2325
    4525        

  Any Suggestions?


        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Dec 21 22:31:43 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:40 EST