[R] reshaping issue

From: Stijn Van Daele <Stijn.VanDaele_at_ugent.be>
Date: Tue, 17 May 2011 19:31:32 +0200


Dear R users,

I have a problem with reshaping data. I know such questions have been asked before, but I can't get it right, neither with the reshape function nor with the melt function.

My dataset has about 407 variables and about 48000 cases.

Each case looks as follows:
V1 v2 v3 v4 v5 v6 v7 x1 y1 x2 y2 .... x200 y200

V1 is unique, v2-v7 are settings (that are linked to V1) and x and y are measures

What I would like is for each V1 is a combination of its unique id, the settings that apply to that case and then the X and Y values (these are linked to each other, so belong in the same row). Something like this:

V1     v2     v3    v4    v5    v6     v7    x1     y1
V1     v2     v3    v4    v5    v6     v7    x2     y2 
...
V1     v2     v3    v4    v5    v6     v7    x200     y200 

I have difficulties with the fact that I have two varying variables (x and y) that should stay together.

Could anyone help this R-newbie out?

Thanks in advance,
Stijn



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 Tue 17 May 2011 - 17:39:16 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Tue 17 May 2011 - 22:10:07 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