# NOT RUN {
fpath_i <- system.file("extdata", extdata_fnames[1], package = "arctools")
dat_i <- as.data.frame(data.table::fread(fpath_i))
acc <- dat_i$vectormagnitude
acc_ts <- lubridate::ymd_hms(dat_i$timestamp)
## Example 1
## Summarize PA
activity_stats(acc, acc_ts)
## Example 2
## Summarize PA within minutes range corresponding to 12:00 AM - 6:00 AM
subset_12am_6am <- 1 : (6 * 1440/24)
activity_stats(acc, acc_ts, subset_minutes = subset_12am_6am)
## Example 3
## Summarize PA without (i.e., excluding) minutes range corresponding to 11:00 PM - 5:00 AM.
subset_11pm_5am <- c(
(23 * 1440/24 + 1) : 1440, ## 11:00 PM - midnight
1 : (5 * 1440/24) ## midnight - 5:00 AM
)
activity_stats(acc, acc_ts, exclude_minutes = subset_11pm_5am)
# }
Run the code above in your browser using DataLab