How can we compare corresponding values of x and y (first value of x exacly matches with the first value of y)?
On 08/17/2012 07:48 PM, Sri krishna Devarayalu Balanagu wrote:
df<- data.frame (
"RowId" = 4:7,
"x"=c("1_1", "2_2", "3_3", "3_3"),
"y"=c("1_1", "3_3", "2_2", "3_3")
)
How can we compare corresponding values of x and y (first value of x exacly matches with the first value of y)?
If they were not matced exactly how can we get the row id?
In this case the row ids were 5 and 6.
Hi Sri krishna Devarayalu Balanagu, how about this: df$RowId[which(df$x != df$y)] Jim