6
I have two data frame (see below) with information on consumption and gain of animals. Consumption was collected each day and gain in larger intervals. I want to join one next to the other, having a column of Animal, Day, Consumption and Gain. In this case, in gain, where there is no information, keep as NA. How can I do that?
DfConsumo
Animal Dia Consumo
5 2 1959.44
5 4 2015.125
5 5 2062.513
5 6 2102.862
5 7 2157.486
5 8 2213.519
5 9 2279.803
5 10 2317.222
5 11 2428.641
6 3 2000
6 4 2041.661
6 5 2049.473
6 6 2111.409
6 7 2149.92
6 8 2153.251
6 9 2207.271
6 10 2246.633
6 11 2297.115
DfGanho
Animal Dia Ganho
5 2 0.95
5 9 0.95
6 3 0.95
6 9 0.96
Possible duplicate of Search for values in one data.frame and add to another (R)
– Daniel Falbel