[R] inverse function of melt

From: <n.vialma_at_libero.it>
Date: Fri, 18 Jun 2010 15:39:21 +0200 (CEST)

Dear list,
I'm looking for an inverse function of melt(which is in package reshape).Namely, I had a data frame like this
(Table1)

YEAR VAR1 VAR2 VAR3
1995 7 3 45

1996 5 6 32

1997 6 10 15
I transformed my data by using the melt function and my data was reshaped in the following format:
(Table2)

YEAR variable value

1995 VAR1 7 1996 VAR1 5

1997         VAR1             6
1995        VAR2              7

1996         VAR2             5

1997         VAR2             6
1995        VAR3              7

1996         VAR3             5

1997         VAR3             6

 Now I would like to come back to the original format, namely table1. Anyone could help me??
Thanks for your attention!  

        [[alternative HTML version deleted]]



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 Fri 18 Jun 2010 - 13:42:32 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 Fri 18 Jun 2010 - 20:50:33 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