Runs asleep::asleep() on complete, time-ordered raw triaxial acceleration
and converts its predictions to the common acti_sleep_estimate format.
Usage
acti_asleep(
data,
min_wear_hours = 22L,
time_shift = "0",
report_light_and_temp = FALSE,
pytorch_device = c("cpu", "cuda:0"),
sample_rate = NULL,
verbose = TRUE,
force_download = FALSE,
tz = NULL
)
acti_calculate_asleep(
data,
min_wear_hours = 22L,
time_shift = "0",
report_light_and_temp = FALSE,
pytorch_device = c("cpu", "cuda:0"),
sample_rate = NULL,
verbose = TRUE,
force_download = FALSE,
tz = NULL
)Arguments
- data
A data frame containing timestamps and triaxial acceleration, or a readable accelerometry file path. File paths are passed unchanged to
asleep::asleep().- min_wear_hours
Minimum daily wear time used by
asleepsummaries.- time_shift
Clock-time correction passed to
asleep::asleep().- report_light_and_temp
Whether to request light and temperature output.
- pytorch_device
Device used for prediction.
- sample_rate
Optional input sample rate.
- verbose
Whether
asleepprints progress messages.- force_download
Whether to re-download
asleepmodel files.- tz
Time zone of the recording and the returned times. By default the time zone of
data$time, or"UTC"whendatais a file path; set it to the recording's time zone for file input.asleepworks on local clock times without a time zone and splits the recording into noon-to-noon days on that clock.For data-frame input, the clock passed to
asleepis held at the UTC offset in effect at the start of the recording, as a device clock is, so it never repeats or skips an hour at a daylight-saving transition. The returned times are the exact instants of the input, shown intz.For file input, the device clock times that
asleepreports are taken as clock times intz. File and data-frame input of the same recording can therefore differ after a daylight-saving transition: a device clock that does not change for daylight saving is an hour off fromtzuntil the clocks change back. This difference is known. To match such a device clock, use a fixed-offset time zone, e.g.tz = "Etc/GMT-1"for UTC+1.