I am new in R and I am trying to solve something.
I have three columns Employee, Location and Manager. I need to find if the manager for each employee is local or not, meaning that they have the same location (based on the employee column, as every manager is also an employee). For example, Manager 24 checks on locations A and B, but is a local manager only for employee 12, but not for employee 54. I want to add a new column named localManager and return "yes" or "no".
I hope that is clear. Thank you for the help!
| Employee | Location | Manager |
|---|---|---|
| 12 | A | 24 |
| 54 | B | 24 |
| 24 | A | 52 |
| 30 | C | 63 |