Description Usage Arguments Details Value Examples
View source: R/midnight_to_midnight.R
Expand activity data vector such that its length is a multiple of number of minutes in a full day (1440).
1 | midnight_to_midnight(acc, acc_ts)
|
acc |
A numeric vector. A minute-level activity counts data vector. |
acc_ts |
A POSIXct vector. Time of activity data collection, corresponding to
|
In the returned vector,
1st observation
corresponds to minute of 00:00-00:01 on the first day of data collection,
and last observation
corresponds to minute of 23:50-00:00 on the last day of data collection.
Entries corresponding to no data in original activity data vector
are filled with NA
.
A numeric vector. A minute-level activity counts data vector in midnight-to-midnight format.
1 2 3 4 5 6 7 8 9 | ## Read exemplary data
fpath_i <- system.file("extdata", extdata_fnames[1], package = "arcstats")
dat_i <- as.data.frame(data.table::fread(fpath_i))
acc <- dat_i$vectormagnitude
acc_ts <- lubridate::ymd_hms(dat_i$timestamp)
## Get acc data vector in "midnight_to_midnight" format
acc <- midnight_to_midnight(acc, acc_ts)
## Observe we have an integer number of days
length(acc) / 1440
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.