The function is used by g.part5 to derive time series fragmentation metrics. The function assumes that NA values and nonwear time is accounted for before the data enters the function.
g.fragmentation(frag.metrics = c("mean", "TP", "Gini", "power",
"CoV", "NFragPM", "all"), LEVELS = c(), Lnames=c(), xmin=1, mode = "day")
List with Character object showing how decimals are separated
Transition probability physical activity to inactivity
.
Transition probability physical inactivity to activity
Number of inacitivty fragments succeeded by LIPA (light physical activity)
Transition probability physical inactivity to LIPA
Number of inacitivty fragments succeeded by MVPA (moderate or vigorous physical activity)
Transition probability physical inactivity to MVPA
Number of MVPA fragments
Number of LIPA fragments
mean MVPA fragment duration
mean LIPA fragment duration
Number of inactivity fragments
Number of activity fragments
mean duration inactivity fragments
mean duration activity fragments
Gini index corresponding to inactivity fragment durations
Gini index corresponding to activity fragment durations
Coefficient of Variance corresponding to inactivity fragment durations
Coefficient of Variance corresponding to activity fragment durations
Alpha of the fitted power distribution through inactivity fragment durations
Alpha of the fitted power distribution through activity fragment durations
x0.5 corresponding to alpha_dur_IN
x0.5 corresponding to alpha_dur_PA
W0.5 corresponding to alpha_dur_IN
W0.5 corresponding to alpha_dur_PA
Number of IN fragments per minutes in IN
Number of PA fragments per minutes in PA
Standard deviation in the duration of inactivity fragments
Standard deviation in the duration of physical activity fragments
Character with fragmentation metric to exract. Can be "mean", "TP", "Gini", "power", or "CoV", "NFragPM", or all the above metrics with "all". See details.
Numeric vector of behavioural level classes derived with identify_levels
Character vector with names of classes used in LEVELS, see details.
Numeric scalar to indicate the minimum recordable fragment length. In g.part5 this is derived from the epoch length.
Character to indicate whether input data is daytime ("day") or sleep period time ("spt").
Vincent T van Hees <v.vanhees@accelting.com>
See package vignette for description of fragmentation metrics. In short, abbreviation "TP" refers to transition probality metrics, abbreviation "CoV" refers to Coefficient of Variance, and metric "NFragPM" refers to the Number of fragments per minute.
Regarding the Lnames argument. The class names included in this are categorised as follows:
Inactive, if name includes the character strings "day_IN_unbt" or "day_IN_bts"
LIPA, if name includes the character strings "day_LIG_unbt" or "day_LIG_bts"
MVPA, if name includes the character strings "day_MOD_unbt", "day_VIG_unbt", or "day_MVPA_bts"
if (FALSE) {
x = c(6, 5, 6, 7, 6, 6, 7, 6, 6, 5, 6, 6, 6, 5, 7, 6, 6, 5, 5, 5, 6, 7, 6,
6, 6, 6, 7, 6, 5, 5, 5, 5, 5, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 6, 5, 6, 5, 6, 5, rep(12, 11), 5, 6, 6, 6, 5, 6, rep(9, 14), 6,
5, 7, 7, 6, 7, 7, 7, 6, 6, 6, 5, 6, 5, 5, 5, 6, 5, 5, 5, 5, 5, 5, 5)
Lnames = c("spt_sleep", "spt_wake_IN", "spt_wake_LIG", "spt_wake_MOD",
"spt_wake_VIG", "day_IN_unbt", "day_LIG_unbt", "day_MOD_unbt",
"day_VIG_unbt", "day_MVPA_bts_10", "day_IN_bts_30",
"day_IN_bts_10_30", "day_LIG_bts_10")
out = g.fragmentation(frag.metrics = "all",
LEVELS = x,
Lnames=Lnames)}
Run the code above in your browser using DataLab