# NOT RUN {
## Read exemplary data
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)
## Get acc data vector in "midnight_to_midnight" format
acc <- midnight_to_midnight(acc, acc_ts)
## Get wear/non-wear flag
wear_flag <- get_wear_flag(acc)
## Get valid/non-valid day flag
valid_day_flag <- get_valid_day_flag(wear_flag)
## Impute missing data in acc data vector
acc_imputed <- impute_missing_data(acc, wear_flag, valid_day_flag)
## Compare mean acc before/after imputation
c(mean(acc, na.rm = TRUE), mean(acc_imputed, na.rm = TRUE))
# }
Run the code above in your browser using DataLab