Hey there,
I have the following data table and I want to transpose it that way:
Result:
I tried by usind soming like this, but it doesn't work:
dt.data <- data.table("date" = rep(dt.diff$date, ncol(dt.diff)-1),
"daysAhead" = names(dt.diff)[-1],
"deviation" = t(dt.diff[, 2:ncol(dt.diff)]))
Thank you