Getting the average for non-numeric values

Dear all,
it is probably super simple, but I cant wrap my head around it.
I have a dataset which shows which author citied who atr what date:
‘date’: Year of citing
‘author1’: citing author
‘country’: where is the citing author from
‘author2’: cited author
I now, want to find out how many citations author2 received, grouped by date and country

In general, I thought about doing something similar to

df %>%
  group_by(date, country, author2) %>%
  summarize(m = mean(….))

But that doesn’t work (not sure, if that is because of the non-numeric values or if I just have a complete different error in reasoning).
I also thought about using ‘add_tully()’/’add_count()’ first, but that also doesn’t work.
Maybe someone can help be understand my problem.
Thank you so much in advance.

"How many citations" would be a count not an average, you can't average non numeric values, but you can count them. Try the count() function.

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

There's a nice, short post on computing the mode in R here

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.