Let me explain my problem a little more clearly. Let's say I have two dataframes, A and B, and they look something like this.
Dataframe A
Names Email
1 John a@a.com
2 Harry b@b.com
3 Amy c@c.com
4 Jim d@d.com
5 Chad e@e.com
Dataframe B
Email Category
1 q@q.com Student
2 z@z.com Faculty
3 h@h.com Alumni
4 c@c.com Student
5 a@a.com Alumni
My goal is to create a new column in dataframe A called Category, which will have a value equal to B$Category if a value in A$Email matches any value in B$Email, and NA otherwise. Here is my ideal output
Dataframe A
Names Email Category
1 John a@a.com Alumni
2 Harry b@b.com NA
3 Amy c@c.com Student
4 Jim d@d.com NA
5 Chad e@e.com NA
What would be the best way to go about this?