I just want to reshape the following data set:
Here is the code to generate the following df:
data.frame(Variable = c("Date","Location_1","Location_2","Date","Location_1","Location_2"),
Monday = c("7/1/20","1","2","7/3/20","1","2"),
Tuesday = c("7/2/20","5","2","7/4/20","5","2"))
Variable Monday Tuesday
Date 7/1/20 7/2/20
Location_1 1 5
Location_2 2 2
Date 7/3/20 7/4/20
Location_1 1 5
Location_2 2 2
The shape of the data frame should look like:
Date Location_1 Location_2
7/1/20 1 2
7/2/20 5 2
7/3/20 1 2
7/4/20 5 2
Kindly help...