I have two data frames; one is a list of individual ID codes for my animals with an associated emergence date (31 rows), and the other is a list of weight data dates for these individuals (8474 rows). I would like to work out the time difference for each weight data row from the emergence date, to investigate weight gain since emergence for each individual animal.
I would like to add a new column to the weights dataframe that has the emergence date associated with the correct individual, so that each row has the individual ID, the emergence date for the individual, and the weights date. I can then calculate the difference in days.
I have looked at different methods for joining dataframes but can't find any for this particular function to associate new data
I would like a new column in the weights data that contains the emergence date for each individual