I have a dataframe with pedigree information like so:
FamilyID MomID DadIDv Nummales_Env1 Numfemales_Env1 Nummales_Env2 Numfemales_Env2
I want to generate a new data frame that now has the information for each individual like so:
FID-Num MomID DadID Sex Env
For example if the following is my original data frame with some example values for each column:
FamilyID MomID DadIDv Nummales_Env1 Numfemales_Env1 Nummales_Env2 Numfemales_Env2
AB, A, B, 2, 3, 4, 2
I would then have 11 rows in my new dataframe
FID-Num MomID DadID Sex Env
AB-1, A, B, M, 1
AB-2, A, B, F, 1
AB-3, A, B, M, 2
...
Is there a for loop I can write for this?
It might make it easier to answer the question if you had a few example lines from the data.frame you are starting with, and an example of what you want the output to look like.
Good suggestion! The top is what I have and the bottom is an example of what I'm looking for
Example for just the first row from first data frame into second dataframe.