I have a data frame like this one:
date_time id Temp
2012-02-27 00:12:30 | Sens_1 | 25.2
2012-02-27 00:13:00 | Sens_1 | 25.5
2012-02-27 00:13:30 | Sens_1 | 26.3
2012-02-27 00:14:00 | Sens_1 | 26.3
2012-02-27 00:14:30 | Sens_1 | 26.3
: : :
2012-02-27 00:12:30 | Sens_2 | 35.4
2012-02-27 00:13:00 | Sens_2 | 36.5
2012-02-27 00:13:30 | Sens_2 | 38.8
2012-02-27 00:14:30 | Sens_2 | 36.3
: : :
2012-02-27 00:12:30 | Sens_3 | 15.4
2012-02-27 00:13:00 | Sens_3 | 15.5
2012-02-27 00:13:30 | Sens_3 | 16.8
2012-02-27 00:14:30 | Sens_3 | 16.3
: : :
And I want to get another data frame that looks like this:
date_time Sens_1 | Sens_2 | Sens_3
2012-02-27 00:12:30 | 25.2 | 35.4 | 15.4
2012-02-27 00:13:00 | 25.5 | 36.5 | 15.5
2012-02-27 00:13:30 | 26.3 | 38.8 | 16.8
2012-02-27 00:14:00 | 26.3 | NA | NA
2012-02-27 00:14:30 | 26.3 | 36.3 | 16.3
: : : :
How can I achieve that? Despite that in the piece of df I put above all the three variables got the same "date_time" value (and so it is in most of the cases) there are certain rows where any subgroup of variables can have a certain "date_time" value and the rest won't.