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 [email protected]
2 Harry [email protected]
3 Amy [email protected]
4 Jim [email protected]
5 Chad [email protected]
Dataframe B
Email Category
1 [email protected] Student
2 [email protected] Faculty
3 [email protected] Alumni
4 [email protected] Student
5 [email protected] 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 [email protected] Alumni
2 Harry [email protected] NA
3 Amy [email protected] Student
4 Jim [email protected] NA
5 Chad [email protected] NA
What would be the best way to go about this?