I have a DF as follows:
'data.frame': 6082 obs. of 3 variables:
$ ID : int 23418 23499 24468 24492 24574 24772 25020 25070 25299 25564 ...
$ Week: Factor w/ 12 levels "77-83 DIM","84-90 DIM","91-97 DIM",....
$ kg : num 55.4 56.1 54.9 48 52.8 ...
This is an example:
ID Week kg
1 23418 105-111 DIM 55.43655
2 23499 105-111 DIM 56.11586
3 24468 105-111 DIM 54.85228
4 24492 105-111 DIM 47.96415
5 24574 105-111 DIM 52.80463
6 24772 105-111 DIM 49.99884
There is an image attached as well.
I have 610 different ID numbers that are repeated up to 12 time (weeks). But not all the ID numbers have 12 weeks. I need a DF whit 13 columns: ID, 77-83 DIM, 84-90 DIM, 91-97 DIM ... This means one column per each week and a single column for ID. The containing of the table has to be filled with Kg values.
I am sorry if I am not clear enough. Can somebody help me please? Thanks