Estimates sleep from wrist accelerometry and epoch-level activity data. Implements sleep-period-time guiders based on angle changes, posture, least-active periods, sustained inactivity, low activity,
翻譯準備中
健康RGitHub @jhuwit上線中營運者未確認
試用過了嗎? 點一下就好,不需要登入。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Create Sleep Measures of Actigraphy and Activity Analysis
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗actisomni estimates sleep from wrist-worn accelerometry. It provides
sleep-period-time (SPT) guiders, sustained-inactivity-bout (SIB) labels,
consensus sleep labels, diary helpers, and wrappers for the asleep and
sleeper machine-learning models.
The guider functions identify a likely main sleep window. Combine one or more guiders with a SIB label when an epoch-level sleep/wake label is needed.
actisleep?The original package name was actisleep, but that conflicted with a
previous R package: https://CRAN.R-project.org/package=ActiSleep.
Install the development version from GitHub:
# install.packages("remotes")
remotes::install_github("jhuwit/actisomni")
For epoch-level activity data, use an activity-based guider such as L5
and then apply a SIB label. The result has one logical sleep label per
epoch.
library(actisomni)
time <- as.POSIXct("2020-01-01 18:00:00", tz = "UTC") + 0:1439 * 60
epochs <- data.frame(
time = time,
activity = c(rep(20, 240), rep(0, 420), rep(20, 780)),
sib = c(rep(FALSE, 240), rep(TRUE, 420), rep(FALSE, 780))
)
guider <- acti_sleep_l5(epochs)
epochs$sleep <- acti_sleep_label(epochs$sib, guider)
head(epochs)
#> time activity sib sleep
#> 1 2020-01-01 18:00:00 20 FALSE FALSE
#> 2 2020-01-01 18:01:00 20 FALSE FALSE
#> 3 2020-01-01 18:02:00 20 FALSE FALSE
#> 4 2020-01-01 18:03:00 20 FALSE FALSE
#> 5 2020-01-01 18:04:00 20 FALSE FALSE
#> 6 2020-01-01 18:05:00 20 FALSE FALSE
For raw X/Y/Z acceleration, acti_sleep_sib() calculates the van Hees
SIB indicator and acti_sleep_ensemble() combines compatible guiders
into a consensus label. The example recording supplied by actiread can
be used directly:
library(actiread)
raw <- actiread::acti_read_gt3x(
actiread::acti_example_gt3x(),
verbose = FALSE
)
result <- acti_sleep_ensemble(raw, epoch = "5 seconds")
result$label_data
result$labels retains one label per guider, while result$fused
contains the consensus probability and logical consensus label.
When diary times are available, create a guider directly from onset and wake times. Times are inclusive at both endpoints.
diary_window <- acti_sleep_diary(
epochs,
onset = as.POSIXct("2020-01-01 22:00:00", tz = "UTC"),
wakeup = as.POSIXct("2020-01-02 06:00:00", tz = "UTC")
)
sum(diary_window$window)
#> [1] 481
acti_asleep() and acti_sleeper() both require complete, strictly
time-ordered raw triaxial data. They return the same columns: time,
sleep, sleep_probability, sleep_stage, nonwear, and method.
The models and their Python requirements are managed by the upstream
packages. For sleeper, download the model files first and provide
their directory as model_dir.
asleep_estimate <- acti_asleep(raw, verbose = FALSE)
sleeper_estimate <- acti_sleeper(raw, model_dir = "path/to/sleeper-models")
This work was supported by NIH P30AG021334 and the Johns Hopkins Older Americans Independence Center (OAIC) Pepper Center grant.