I have two dataframes with the same number of columns but different number of rows.
For example
df1
name1 name2 name3
a A B G
b D A R
c F T Q
d Y W A
e G Y D
df2
name1 name2 name3
a A B C
b D A I
c A T G
e G Y D
f E T G
g A C T
My dataframes are much bigger than this examples. Is there any simple way to remove rows from first dataframe which don't exist in second dataframe? I have to remove rows by rownames, so the output should be:
df1
name1 name2 name3
a A B G
b D A R
c F T Q
e G Y D
d
row was removed because it isn't in the second dataframe.