Creating a count for individuals in a given year

Hi R community,
I wonder if any of you could offer any suggestions to help with my data?
I'm looking at social relationships in monkeys and half calculated for all social partners, whether these are kin or non-kin. What I now want to do is calculate how many kin partners each individual monkey had in each year.
I have monkey ID, year, group (group the monkey lives in) and kinship(kin or non-kin) as my factors.
So i'm trying to calculate how many kin partners an individual has in each year. The group variable is probably irrelevant here, because they only have social relationships with members of their own group.
Any help would be kindly appreciated.

counting things is generally fairly easy in R, so you should be hopeful.

How about making a reprex to start ?

Thank you for sending this, but honestly i'm lost. I'm fairly new to R and its tricky. In the guide you sent, its using numeric values, does it matter that mine are categorical? What does a reprex actually do? Does it combine two variables?

A REPRoducible EXample (REPREX) is a means to effectively explain your coding problem to others by providing a common reference frame. The link given to you is not meant to directly solve your problem but to inform you how to properly (and effectively) ask for help.

Please read the guide and try to provide a reproducible example so we can take a look at your problem and try to help you.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.