I know some basic R but I'm stuck with this dataframe handling. I need to be able to use a package or base function in R to transoform a dataframe like this.
id   value    variable 
1    25.5     max_temp
1    16.4     min_temp
2    23.1     max_temp 
3    12.1     min_temp
into this:
id   max_temp    min_temp
1     25.5        16.4
2     23.1         NA
3     NA           12.1
Check the NA example as some observations have missing measurements. Actually I can fix it directly in excel file but I'm trying to do preprocessing less manually.
Thanks.
 
    