Determines the native epoch from the first two time stamps, decimates to
1-minute resolution (if needed), checks total minutes \(\ge\) 1440*min_days,
and within that finds the longest contiguous segment where runs of
consecutive zeros do not exceed max_zero_run minutes.
screen_wear(
df,
min_days = 5L,
max_zero_run = 120L,
date_col = "Date",
time_col = "Time",
activity_col = "Activity"
)A list with elements:
"ok" if a qualifying segment is found, otherwise a message.
Detected original epoch in seconds (15, 30, 60).
Indices of the kept segment in the input.
Minute-level data.frame of the selected segment (if ok).
data.frame with columns Date, Time, Activity in time order.
Integer minimum number of whole days required (default 5).
Integer maximum allowed length (minutes) of a run of zeros.
Name of the date column.
Name of the time column.
Name of the activity column used to determine wear/non-wear.
Decimation rule: 15 s \(\rightarrow\) factor 4; 30 s \(\rightarrow\) factor 2;
60 s \(\rightarrow\) factor 1. The zero-run criterion is applied on the
1-minute Activity series.
import_acti_file(), sleep_cos(), sleep_detection()