I have a data set with three columns The first column includes variable names, the second column include time stamps, and the third column is the value For example
var1, 2015-1-1, 20
var1, 2015-1-2, 30
var2, 2015-1-1, 40
var2, 2015-1-2, 50
I'd like to convert the data set from this format to a format with the first column of time stamp, and the rest columns for each variable value. Can anyone provide a hint using R data.table or reshape package? For example:
2015-1-1, 20, 40
2015-1-2, 30, 50