Identifies bouts for epoch-by-epoch categorical classifications generated by
external functions with reporttype = "type" in GGIR Part 5.
The function converts the external function type information stored in the Part 5 time series into a representation suitable for subsequent summary analysis. It creates epoch-level type durations and identifies bouts for each classification type according to the specified bout duration, bout criterion, and type priority.
identify_levels_ExtFunType(ts, myfun, ws3)A list containing:
TLEVELSA nested list keyed first by external-function output column and then by classification level. Each leaf is a matrix with one row for each bout-duration definition and one column for each epoch. Values of 1 indicate epochs included in the corresponding bout.
TOLEVELSA named list with one matrix per external-function output column. Each matrix contains the number of seconds in each epoch assigned to each classification level; rows represent epochs and columns represent levels.
TnamesA character vector containing the names corresponding to the bout
definitions stored in TLEVELS.
Data frame containing the Part 5 epoch-level time series, including the columns generated for external function type classifications.
List defining the external function. The function uses
reporttype, colnames, tbout.dur,
tbout.criter, and tbout.order when available.
Numeric value specifying the epoch duration in seconds.
Vincent T van Hees <[email protected]> Jairo H Migueles <[email protected]>
The function is used internally by identify_levels when an external
function has reporttype = "type".
Type classifications are represented using the ExtFunType_*_s
columns in ts. Original classification labels, including case, are
preserved. Values supplied through tbout.order are matched to those
labels case-insensitively.
If tbout.dur is not specified, the default bout durations are
c(1, 5, 10) minutes. If tbout.criter is not specified, the
default bout criterion is 0.8. If tbout.order is not specified, the
classification types are ordered alphabetically.
Bout durations are processed from longest to shortest. When multiple
classification types overlap, the order specified by tbout.order
determines the priority with which epochs are assigned to bouts.
The function does not split bouts according to sleep period time or daytime. The resulting bout masks can therefore span these boundaries and are subsequently restricted to the relevant period during Part 5 analysis.
The function is intended to be called internally and is not normally called directly by users.
identify_levels,
g.part5_analyseSegment_ExtFunType