[R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Kaushik Krishnan
Hi folks I have two data frames. I know that the nth (let's say the 7th) row in the first data frame (sequence) is there in the second (today.sequence). When I try to check that by doing 'sequence[7,] %in% today.sequence', I get all FALSE when it should be all TRUE. I'm certain I'm making some

Re: [R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Sundar Dorai-Raj
?%in% says x and table must be vectors. You supplied data.frames. So %in% is coercing your today.sequence to a vector using as.character(today.sequence) Perhaps you should paste the columns together first: x - do.call(paste, c(sequence, sep = ::)) table - do.call(paste, c(today.sequence, sep =

Re: [R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Charles C. Berry
Kaushik, The documentation doesn't quite tell (me, anyway) how the function behaves when 'target' is a list (or data.frame). You'll need to dig into match.c or experiment with match() or %in% to see what it is actually doing. But it looks like it is matching whole columns of the data.frame