GetDiary_subj {ActiSleep} | R Documentation |
Diary In/Out-bed Times
Description
Obtain table of in-bed and out-bed times from sleep diary data
Usage
GetDiary_subj(datain, subj_idx, idx_bed, idx_wake, tz = "GMT")
Arguments
datain |
input dataset, must be a data frame |
subj_idx |
index indicating subject |
idx_bed |
array specifying indices for in-bed time data |
idx_wake |
array specifying indices for out-bed time data |
tz |
timezone, default is GMT |
Value
dataframe with in-bed and out-bed times
Examples
data("SleepDiary1Week")
SleepDiary1Week <-
ChangeTimeVar(SleepDiary1Week, c(5:18), format = "%m/%d/%Y %H:%M")
colIdx_diary_bed <- c(1:7) * 2 - 2 + 5
colIdx_diary_wake <- c(1:7) * 2 - 1 + 5
GetDiary_subj(
SleepDiary1Week,
1,
colIdx_diary_bed,
colIdx_diary_wake,
tz = "GMT")
[Package ActiSleep version 0.2.2 Index]