Below is the example of my data :
Parents | Age | Child1 | Child2 | Child2 |
---|---|---|---|---|
Adrian | 42 | santos | Jennie | NA |
Barbar | 32 | michel | briane | Celloy |
Celice | 29 | pierre | NA | NA |
The goal is to create only 3 columns (Parents, Age and Child) like the example below :
Parents | Age | Childs |
---|---|---|
Adrian | 42 | santos |
Adrian | 42 | Jennnie |
Barbar | 32 | michel |
Barbar | 32 | briane |
Barbar | 32 | celloy |
Celice | 29 | pierre |
An observation contains only one child from one parents If parents have more than one child, the other child will be displayed on the next row.
Coul you help me to solve this problem please ? Because i'm really beginner in R Thank you very much for your assistance!