Estimate time in light intensity activity
lit_min_ap.Rd
This function estimates time spent in light intensity activity. Light intensity activity is activity in the standing or stepping posture.
Details
This function is an adaptation of
activpalProcessing::lit.min.AP()
, where the dependencies on certain MET
values to determine standing and stepping is excluded.
Examples
set.seed(1997)
n <- 100
mets <- stats::rgamma(n = n, shape = 2)
posture <- rep(NA, n)
for (i in seq_along(posture)) {
if (mets[i] < 1.5) {
posture[i] <- sample(c(0, 1), 1, TRUE, c(0.75, 0.25))
} else if (mets[i] >= 1.5 && mets[i] < 3) {
posture[i] <- sample(c(0, 1, 2), 1, TRUE, c(0.25, 0.5, 0.25))
} else {
posture[i] <- sample(c(1, 2), 1, TRUE, c(0.25, 0.75))
}
}
lit_min_ap(mets = mets, posture = posture)
#> [1] 0.8