g.part4(datadir=c(),metadatadir=c(),f0=f0,f1=f1,idloc=1,
loglocation = c(),colid = 1,coln1 = 9,nnights = 7,
sleeplogidnum=FALSE,do.visual=FALSE,outliers.only = FALSE, excludefirstlast=FALSE,criterror = 1,includenightcrit=4, relyonsleeplog=FALSE,def.noc.sleep=c(), storefolderstructure=FALSE,overwrite=FALSE)nightsummary and comes with the following variables:
id Participant id extracted from file
night Night number
acc_onset Detected onset of sleep expressed as hours
since the previous midnight
acc_wake Detected waking time (after sleep period)
expressed as hours since the previous midnight
acc_timeinbed Difference between onset and waking time.
acc_def Definition of sustained inactivity by accelerometer
sleeplog_onset Sleep onset derived from sleep log
or specified by researcher if not sleep log is available
sleeplog_wake Waking time derived from sleep log or
specified by researcher if not sleep log is available
sleeplog_timeinbed Time in bed derived from
sleep log or specified by researcher if not sleep log is available
error_onset Difference between sleep onset as
estimated by accelerometer and estimated by sleeplog/defined by researcher
error_wake Difference between waking time as estimated
by accelerometer and estimated by sleeplog/defined by researcher
fraction_night_invalid Fraction of the night for which
the data was invalid, e.g. monitor not worn or no accelerometer
measurement started/ended within the night
acc_dur_noc Total sleep duration, which equals the
accumulated nocturnal sustained inactivity bouts. This is not the same
as the time in bed, which only looks at time difference between falling
asleep and waking up.
acc_dur_sibd Accumulated sustained inactivty bouts
during the day. These are the periods we would label during the night
as sleep, but during the day they form a subclass of inactivity,
which may represent day time sleep or wakefulness while being
motionless for a sustained period of time
acc_n_noc Number of noturnal sleep periods
acc_n_sibd Number of sustained inactivity periods
during the day
acc_onset_ts acc_onset formatted as a timestamp
acc_wake_ts acc_wake formatted as a timestamp
sleeplog_onset_ts sleeplog_onset formatted as a timestamp
sleeplog_wake_ts sleeplog_wake formatted as a timestamp
page pdf page on which the visualisation can be found
daysleeper If 0 then the person is a nightsleeper
(sleep period did not overlap with noon) if value=1 then the person
is a daysleeper (sleep period did overlap with noon)
weekday Day of the week on which the night started
calendardate Calendar data which the night started
filename Name of the accelerometer file
cleaningcode 0: no problem; 1: sleeplog not available,
2: not enough valid accelerometer data, 3: no accelerometer data available,
4: there were no nights to be analysed for this person
sleeplog_used Whether a sleep log was used (TRUE/FALSE)
acc_available Whether accelerometer data was available
(TRUE/FALSE). This dataframe is used in g.report.part4 to create
two reports one per night and one per person.
sleeplog_used Whether a sleeplog was available (TRUE)
or not (FALSE)
n_nights_acc Number of nights of accelerometer data
n_WE_nights_complete Number of weekend nights complete
which means both accelerometer and sleeplog data
n_WD_nights_complete Number of weekday nights complete
which means both accelerometer and sleeplog data
n_WEnights_daysleeper Number of weekend nights on which
the person slept until after noon
n_WDnights_daysleeper Number of weekday nights on which
the person slept until after noon
sleeplog_dur_AD_mn Mean sleep duration according to sleeplog
accros all days
sleeplog_dur_AD_sd Standard deviation of sleep duration
according to sleeplog accros all days
sleeplog_dur_WD_sd Standard deviation of sleep duration
according to sleeplog accros weekdays
sleeplog_dur_WE_sd Standard deviation of sleep duration
according to sleeplog accros weekend days## Not run:
# metadatadir = "C:/myfolder/meta" # assumes that there is a subfolder in
# # metadatadir named 'ms3.out' containing the output from g.part3
# g.part4(metadatadir=metadatadir)
# ## End(Not run)
Run the code above in your browser using DataLab