I am trying to improve the quality of my data analysis scripts.
I have been doing several analysis for different clients and very often I have to deal with dates and general notion of Time (hourly/daily/weekly/monthly/yearly).
Everytime, after some time of data analysis, I always end up by building a Shiny dashboard.
I would like to have advice on what is the best way to structure my code when I have event data with date granularity as 'hourly'.
Below is the "restructuration plan" of my different scripts that I have in mind but I would like it to be challenged if you anticipate things that could not be efficient in the following proces:
- Get raw data in with date granularity at hourly level
- Perform the different data analysis at hourly level
- Aggregate at daily/weekly/monthly/yearly only when necessary for building ggplot graphs
- Build Shiny and attach filter for the Date to select granularity of x axis (hourly/daily/weekly/monthly/yearly granularity)
Thanks a lot for any of your advice!
Max