1

I know a similar question has been asked here: Assign unique ID based on two columns, but I think mine is a different problem.

I have a dataset consisting of sibling pairs. This looks like this

enter image description here

As you can see, these are individual IDs for each sibling. The highlighted colours provides you with siblings that are repeated in each column. However, one of the individual (A.2582862) is in column 1 and in column 2 based on who their siblings are.

I now need to assign unique family IDs for each sibling pair, ensuring that an individual does not have two seperate family IDs in the dataset, and ensuring that all siblings have the same family ID. It should look like this:

enter image description here

Any suggestion about how to go about doing this in R?

Thanks!

V-ier
  • 43
  • 3
  • 4
    [See here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) on making an R question that folks can help with. That includes a sample of data (not pictures of it, which we can't run any code on), all necessary code, and a clear explanation of what you're trying to do and what hasn't worked. – camille Dec 03 '19 at 16:30

0 Answers0