I would like to know if, within a same Scan, my Dyadic individuals eat the same resources.
Here is what my data looks like right now:
| Individual | Scan | Food.Consumed | Dyad.ID |
|---|---|---|---|
| A | 1 | Raisins | 1 |
| Aa | 1 | Melon | 1 |
| B | 1 | Raisins | 2 |
| Cc | 1 | Melon | 3 |
| Bb | 1 | Peach | 2 |
| Ee | 1 | Melon | 5 |
| E | 1 | Melon | 5 |
| F | 1 | Peach | 6 |
| Aa | 2 | Melon | 5 |
| C | 2 | Peach | 5 |
| A | 2 | Melon | 6 |
Each Dyad (A-Aa, B-Bb, etc...) has a specific ID number (Dyad.ID) to link the two individuals together. Within a same Scan, the same individual is never mentioned twice. Sometimes, I have data for both individuals in a Dyad, and sometimes I do not (e.g In Scan = 1, the individual F has data collected but not Ff).
I need to add another column where there is information on whether the two individuals in the Dyad ate the same thing or not (or unknown, if the other dyad member doesn't have any data) within a single Scan (and this is what is most important).
The aim would be for my data to look like this:
| Individual | Scan | Food.Consumed | Dyad.ID | Same.Food |
|---|---|---|---|---|
| A | 1 | Raisins | 1 | No |
| Aa | 1 | Melon | 1 | No |
| B | 1 | Raisins | 2 | No |
| Cc | 1 | Melon | 3 | |
| Bb | 1 | Peach | 2 | No |
| Ee | 1 | Melon | 5 | Yes |
| E | 1 | Melon | 5 | Yes |
| F | 1 | Peach | 6 | |
| Aa | 2 | Melon | 5 | Yes |
| C | 2 | Peach | 5 | |
| A | 2 | Melon | 6 | Yes |
I haven't managed to find anything which would allow me to look at same strings within cells of a specific column (here = Food.Consumed) and rows (of the same Dyad ID number), while restricting the search to only within each scan every time (and repeating this for each following scan).
Hopefully this is all clear, thank you for the help!