Close, but not quite. I don't want the data reported by each memberid because I have 200,000 total records with memberids . For example, I just added another 5 records for channel C to my example and the ouput has another row for channel C and 5 records.
df <- tibble(
memberid = c("123","123","123", "123", "123","123","123","234","345","345",
"456", "456","456", "456","456", "456","456","456","567","567", "567","567","567"),
channel = c("A","A","A","A","B","A","B","C","C","C","C","A","B","C","C","C","C","A","C","C","C","C","C"),
master_subordinant = c("M","S","S","S","S","S","S","M","M","S","M","S","S","S","S","S","S","S","M","S","S","S","S")
)
print(df)
df %>%
group_by(channel, memberid) %>%
summarize(n())
1 A 123 5
2 A 456 2
3 B 123 2
4 B 456 1
5 C 234 1
6 C 345 2
7 C 456 5
8 C 567 5
How would I summarize it by list and then summarized count. So C level 5 would have a 2. Does that make sense?