[R] Dataframe modification

From: Ramzi Feghali <ramzi_feg_at_yahoo.fr>
Date: Wed 09 Mar 2005 - 02:44:10 EST


Hello,
I have a problem and wish if anybody have a quick solution or function or if this question was asked before and you could give me the date to look in the archives for the response.
My problem is that I have a dataframe D[663,40] with only one column with repeated values lines and a factor with 4 levels.
I want to reorganize my dataframe, create a dataframe D1[x,40*4] and put the repeated values in one line so that all the factors will be in columns. For the values with a missing level factor I want to keep empty the concerning place.
For example if i a have this dataframe:

A	B	C								
32	a	14								
32	b	22								
55	a	44								
55	b	77								
55	c	55								
55	d	44								
83	c	77								
83	d	55								
83	e	44						

I want to transform it to have this one:
32	a	14	b	22						
55	a	44	b	77	c	55				
83					c	77	d	55	e	44


Thanks & best regards



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 Mar 09 02:52:46 2005

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