Re: [R] transpose dataset

From: Daniel Malter <daniel_at_umd.edu>
Date: Wed, 12 Mar 2008 20:50:09 -0400


if x is your data: t(x)



cuncta stricte discussurus

-----Ursprüngliche Nachricht-----
Von: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] Im Auftrag von Felipe Carrillo
Gesendet: Wednesday, March 12, 2008 8:19 PM An: r-help_at_stat.math.ethz.ch
Betreff: [R] transpose dataset

Hi all:
How can I transpose this dataset from column to row id week value

1      5       51
2      6       73
3      7       41
4      8       22
5      9       83
6      10      55
7      11      42

to something like this...
id 1 2 3 4 5 6 7
week 5 6 7 8 9 10 11
value 51 73 41 22 83 55 42

Felipe D. Carrillo
  Fishery Biologist
  US Fish & Wildlife Service
  California, USA



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 13 Mar 2008 - 01:01:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 13 Mar 2008 - 02:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive