I am trying to count every id that corresponds to an unique id, however the next error keeps arising.
Here's my code:
direct_reports <- data.frame(df %>%
group_by(manager_id) %>%
summarise(number_dr =
count(manager_id)) %>%
select(manager_id, number_dr))
Console output:
Error: Problem with `summarise()` input `number_dr`.
x no applicable method for 'tbl_vars' applied to an object of class "c('double', 'numeric')"
i Input `number_dr` is `count(manager_id)`.
i The error occured in group 1: manager_id = 19292.
Run `rlang::last_error()` to see where the error occurred.