Creating time-activity diagrams to visualise compositional time use patterns of daily activities using R
Code as a research output can either be uploaded directly from your computer or through the code management system GitHub. Versioning of code repositories is supported.
This publication includes two sets of R code.
The first code, named ‘1_set_up_n_create_time_activity_diagram_individual_n_aggregate.R’, has two parts. Part one sets up parameters and loads and processes the data. The original data should be in a format so that the end time of the previous activity episode is equals to the start time of the following activity episode. This makes sure that vertical timelines are continuous. Part two creates a time-activity diagram showing both individual and aggregated patterns. For an example of this visualisation, please see Figure 5 in our open access paper (doi:10.3390/ijerph16050897).
The second code, named ‘2_create_time_activity_diagram_aggregate_n_differences.R’, creates a time-activity diagram showing aggregated patterns and differences between two comparison groups. For an example of this visualisation, please see Figure 4 in our open access paper (doi:10.3390/ijerph16050897).
The two codes should be run sequentially.