Re: [R] compare strings

From: Bernd Jagla <baj2107_at_columbia.edu>
Date: Fri, 30 Nov 2007 22:47:59 -0500

It helps writing down these question, you are then getting much closer to an answer...

summary(as.integer(t3[,2]) == as.integer(t3[,4]) & as.integer(t3[,3]) == as.integer(t3[,5]))

will compare two pairs of column pairs and give a count of flase and true rows...

-B

|-----Original Message-----
|From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On
|Behalf Of Bernd Jagla
|Sent: Friday, November 30, 2007 10:25 PM
|To: r-help_at_r-project.org
|Subject: [R] compare strings
|
|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.



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. Received on Sat 01 Dec 2007 - 03:51:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 01 Dec 2007 - 09:30:16 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.