Reputation: 458
I have a data frame A of the below format
Word Freq
p 9531
can 2085
/p 2055
get 1183
use 1112
and another data frame B
Word Freq
p 10
can 2
/p 55
Now I want to remove the rows from data frame A that has a matching in the data frame B. So my output would be for data frame A
Word Freq
get 1183
use 1112
Upvotes: 0
Views: 99
Reputation: 21507
Do it this way:
A<-read.table(text="Word Freq
p 9531
can 2085
/p 2055
get 1183
use 1112",header=T)
B<-read.table(text="Word Freq
p 10
can 2
/p 55",header=T)
A[-which(A$Word %in% B$Word),]
result:
Word Freq
4 get 1183
5 use 1112
Upvotes: 1