I have a daily time series containing weekdays, excluding weekends. I would like to reorder it so that each column represents a week and the subsequent five rows show the data for Mon, Tue, Wed, Thur and Fri of that week.
I tried using cast
(package: reshape
) but am having problems in obtaining the above.
Thank you for your help.
example:
Date Day Value
06/01/2020 mon 15
07/01/2020 tue 16
08/01/2020 wed 17
09/01/2020 thu 18
10/01/2020 fri 19
13/01/2020 mon 20
14/01/2020 tue 21
15/01/2020 wed 22
16/01/2020 thu 23
17/01/2020 fri 24
to be reformated to:
Start of week mon tue wed thu fri
06/01/2020 15 16 17 18 19
13/01/2020 20 21 22 23 24