I have this data.frame:
> head(ir_dfSTORED)
ind m
1 2015-12-15 21
2 2015-12-15 42
3 2015-12-15 63
4 2015-12-15 84
5 2015-12-15 105
6 2015-12-15 126
> tail(ir_dfSTORED)
ind m
835 2015-12-21 2415
836 2015-12-21 2436
837 2015-12-21 2457
838 2015-12-21 2478
839 2015-12-21 2499
840 2015-12-21 2520
The "ind" column has the dates repeated by 120 rows, i have 7 dates. 120 x 7 = 840 rows.
The "m" column gives me 120 numbers (21, 42, 63, 84, 105, 126,...,2520) for each day. A vector of 120 number for each day.
I want to convert each number of "m" column, from 21 to 2520, as a new column (120 columns).
My final data.frame should have the "ind" column as the first one. And then, the second column should be "21", the third "42", ..., 120th column should be "2520".
After this a would like to have in the "ind" column non repeated dates, only the seven dates (seven rows). Here i know that i can use the unique
command. I believe its not a big problem.
But i cant do the convertion of "m" column.
So, i would have a data frame with 121 columns and 7 rows.
How can i do this?