Hi there,

I have 2 columns in my data frame and I am trying to create a third column called 'ManagerCount'. In excel I can calculate using the Countif function using the column as the range and the cell as the criteria. I am to achieve this in rstudio however. Example below:-

Employee ID

```
EmployeeID ManagerID ManagerCount
80001 NA 1
81928 54629 1
76524 54629 0
54629 80001 2
14973 81928 0
```

Any help would be greatly appreciated.

Regards,

Forrestgump