activity.with.overlay.chart: Combines events file data with observational data for a...

Description Usage Arguments Examples

View source: R/activity.overlay.chart.R

Description

Reads in an events file and overlay file, generating spiral and linear charts aligning the events file data with the corresponding overlay data. Where the overlay data is non-continuous data (such as sleeps diaries) the csv file should have the columns start_time (dd-mm-YYYY HH:MM), end_time (dd-mm-YYYY HH:MM) and category (text). Where the overlay data is continuous data (such as continuous glucose monitoring) the csv file should have the columns start_time(dd-mm-YYYY HH:MM) and category (text). In this case the end time coincides with the start time of the subsequent observation. The charts are saved as png images with two images generated (one spiral chart and one linear chart).
Note: Spiral plots are generated using ggplot2 and coord_polar() and can take 45 - 60 seconds to generate each spiral plot.

Usage

1
activity.with.overlay.chart(events_file, overlay_file, output_folder)

Arguments

events_file

The filepath of the events file. Must be a valid activPAL events csv file

overlay_file

The filepath of the csv file containing the overlay data csv file

output_folder

The filepath of the folder where the generated chart are to be saved to

Examples

1
2
3
4
5
events_file <- system.file("extdata", "Test_Events.csv", package = "activPAL")
sleep_file <- system.file("extdata", "Sleep.csv", package = "activPAL")
output_folder <- paste(tempdir(),"/",sep="")

activPAL::activity.with.overlay.chart(events_file,sleep_file,output_folder)

activPAL documentation built on July 18, 2019, 5:03 p.m.