[R] compare strings

markleeds at verizon.net markleeds at verizon.net
Sat Dec 1 04:50:19 CET 2007


>From: Bernd Jagla <baj2107 at columbia.edu>
>Date: 2007/11/30 Fri PM 09:24:34 CST
>To: r-help at r-project.org
>Subject: [R] compare strings

below assumes that there are only 2 columns in
the dataframe or that the string columns are the 
first two columns ? 

which(df[,1] == df[,2])

>Sorry for the question, but I really cannot find the right search terms to
>find an answer..
>
> 
>
>I have a data frame with strings in some of the columns.
>
>I want to know all the rows where the strings in both columns are equal.
>
> 
>
>How do I do this?
>
> 
>
>Thanks,
>
> 
>
>Bernd
>
>
>	[[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.



More information about the R-help mailing list