I'm trying to run psych::alpha on a dataset grouped by country. group_map works but as expected the list doesn't say countries, it indexes the countries ([[1]] etc) .
The reference site doesn't imply there needs to be any argument additions between group_map and group_modify
Passing through group_modify gives me the error:
Number of categories should be increased in order to count frequencies.
Error: The result of .f should be a data frame.
Backtrace:
1. `%>%`(...)
3. dplyr:::group_modify.grouped_df(., ~psych::alpha(.x, check.keys = TRUE))
5. dplyr:::group_map.data.frame(.data, fun, .keep = .keep)
6. dplyr:::map2(chunks, group_keys, .f, ...)
7. base::mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE)
>