Re: [R] Fast Removing Duplicates from Every Column

From: Bert Jacobs <b.jacobs_at_pandora.be>
Date: Fri 05 Jan 2007 - 08:54:17 GMT


Hi,

I'm looking for some lines of code that does the following: I have a dataframe with 160 Columns and a number of rows (max 30):

		Col1 Col2 Col3 ... Col 159 Col 160 
Row 1 	0 	0 	LD ... 0	   VD 
Row 2 	HD 	0 	0 	 0 	   MD 
Row 3 	0 	HD 	HD 	 0       LD 
Row 4 	LD 	HD 	HD 	 0 	   LD 
...		...
LastRow	HD    HD    LD     0       MD


Now I want a dataframe that looks like this. As you see all duplicates are removed. Can this dataframe be constructed in a fast way?

		Col1 Col2 Col3 ... Col 159 Col 160 
Row 1       0    0    LD       0	    VD
Row 2     	HD   HD   0        0        MD
Row 3     	LD   0    HD       0        LD

Thx for helping me out.
Bert



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 and provide commented, minimal, self-contained, reproducible code. Received on Fri Jan 05 20:24:58 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 06 Jan 2007 - 00: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.