Alarm is a R package of a wearable alarming system for abnormal resting heart rates (RHR) based on CuSum statistics using Fitbit smartwatch data.
-
R (version >= 3.3.0)
-
R package: "xts"
-
R function file: "online_cusum_alarm_fn.R"
To set the working directory as "/Alarm/R"
source("online_cusum_alarm_fn.R")
online.alarming.fn(peo.id.1, dir.hr, dir.step, track.par = 12, gap.thres = 14)
--peo.id.1 individual ID
--dir.hr directory of raw heart rate data
--dir.step directory of raw step data
--track.par tracking parameter (default: 12 hours)
--gap.thres missing data gap (default: 14 days)
-
reformatted HR data, step data, and smoothed RHR data are saved in subfolder /output/clean
-
online result (based on CuSum) and offline result (based on RHR-diff) for each chunk data are saved in subfolder /output/result
-
notice that the CuSum alarm cannot run due to lack of enough data for some case is saved in subfolder /output/note
-
online alarm figure combined with offline detection figure for each chunk data is saved in subfolder /output/figure
-
online summary table, offline summary table, and daily evaluation table for all the data are saved in subfolder /output/table