Re: [R] data manipulation

From: Dieter Menne <dieter.menne_at_menne-biomed.de>
Date: Sun 11 Sep 2005 - 03:27:20 EST

Marc Bernard <bernarduse1 <at> yahoo.fr> writes:

> I would be grateful if you can help me. My problem is the following:
> I have a data set like:
>
> ID time X1 X2
> 1 1 x111 x211
> 1 2 x112 x212
....  

> where X1 and X2 are 2 covariates and "time" is the time of observation and ID
indicates the cluster.
>
> I want to merge the above data by creating a new variable "X" and "type" as
follows:
>
> ID time X type
> 1 1 x111 X1
....

Try reshape. And have courage, this is one of the more complex interfaces in R, very powerful, but intimidating.

Dieter



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 Sun Sep 11 03:35:36 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 16:48:28 EST