3
I have a time series basis. On the basis has information of consumption of pig feed (follows below with information of only one day and one animal). There is a column with identification of the animal, day and time of day that the animal consumed the feed. In the time column I needed it to be 0 to 23, and in the hours that the animal did not consume it to be zero consumption. After that I need to calculate the total consumption every six hours within each day. That is, in the final table it would have only the total consumption from 0 to 5, 6 to 11, 12 to 17 and 18 to 23 hours.
X Animal Dia Hora Consumo
1 1 5 1 1 89.96
2 2 5 1 1 44.98
3 3 5 1 1 74.97
4 4 5 1 2 134.95
5 5 5 1 2 14.99
6 6 5 1 2 59.98
7 7 5 1 9 419.83
8 8 5 1 9 59.98
9 9 5 1 9 74.97
10 10 5 1 9 29.99
11 11 5 1 11 29.99
12 12 5 1 11 194.92
13 13 5 1 13 119.95
14 14 5 1 13 29.99
15 15 5 1 14 59.98
16 16 5 1 16 254.90
17 17 5 1 18 179.93
Hello Marcus! The first part was perfect, it was exactly what I wanted. But the second actually I need to keep table, ie continue with the columns, Time, Animal, Day and now also Period and Total(Consumption). It’s Possible to Do That?
– Luciano Hauschild
I need to continue with the date.frame: Time, Animal, Day and now also Period and Total (Consumption)
– Luciano Hauschild
See the edition I made in the reply. If the problem has been solved, consider accepting the answer given.
– Marcus Nunes