Here I have an example of the ideal input data for time series analysis:
However I receive the raw data like this:
raw_data <- data.frame(matrix(nrow=4, ncol=5))
colnames(raw_data) <- c("site","date","00:00","01:00","02:00")
raw_data$site <- c("A","B","A","B")
raw_data$date <- c("2015-01-01","2015-01-01","2015-01-02","2015-01-02")
raw_data$`00:00` <- c(1,4,1,4)
raw_data$`01:00` <- c(2,5,2,5)
raw_data$`02:00` <- c(3,6,3,6)
I have spent really a lot of time trying to re-arrange the raw data into the ideal structure. Really appreciate any help. Thanks.

