I have a matrix with 24*7 rows(hourly data from the column week) and 52 columns(weeks in a year).
I want to calculate the average day (with 24h) from each week (resulting with a 24-by-52 matrix). Normaly I would reshape
the vector from each week so that I could have 24 rows and 7 columns and then I could make the average from each hour, resulting in a average day from that week.
However, the year has 52 weeks, so this reshape
is not realistic.
Does anyone knows how to calculate the mean of each hour of a day in order to create one mean day using without reshaping the initial column for each week?