[R] How to compare X1 = X2 = ... = Xn?

From: F Duan <f.duan_at_yale.edu>
Date: Tue 20 Jul 2004 - 03:25:33 EST


Dear All,  

I have a data frame with n columns: X1, X2, ., Xn. Now I want to create a new column: if X1 = X2 = . = Xn, the value is 1; Otherwise, the value is 0.  

How to do that in a quick way instead of doing (n choose 2) comparisons?  

Thank you,  

Frank

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list

https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 20 03:48:51 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:36:49 EST