markPAI: Mark Physical Activity Intensity (PAI) Level

Description Usage Arguments Value Author(s) References Examples

View source: R/markPAI.R

Description

This function adds a physical activity intensity level variable “pai” to the source dataset. The “pai” is an ordered factor variable. It will be NA for nonwear times.

Usage

1
2
3
4
5
6
7
markPAI(
  data,
  cts = getOption("pa.cts"),
  markingString = "w",
  breaks = c(-Inf, 100, 760, 2020, Inf),
  labels = c("sedentary", "light", "moderate", "vigorous")
)

Arguments

data

Data with classified wear (nonwear) status by wearingMarking.

cts

The name of the counts column. The default is “axis1”.

markingString

Option for summarizing wear (markingString = “w”) or nonwear time (markingString = “nw”).

breaks

A numeric vector of cut-points. The default cut-points are based on Matthews et al. (2016).

labels

A character vector labelling intensity levels.

Value

A data frame with an additional PAI-level column.

Author(s)

Cole Beck cole.beck@vumc.org, Leena Choi leena.choi@Vanderbilt.Edu

References

Matthews CE, Keadle SK, Troiano RP, Kahle L, Koster A, Brychta R, Van Domelen D, Caserotti P, Chen KY, Harris TB, Berrigan D. Accelerometer-measured dose-response for physical activity, sedentary time, and mortality in US adults. Am J Clin Nutr. 2016 Nov;104(5):1424-1432.

Examples

1
2
3
4
5
6
7
8
9
data(dataSec)

mydata1m = dataCollapser(dataSec, TS = "TimeStamp", col = "counts", by = 60)

data1m = wearingMarking(dataset = mydata1m,
                       perMinuteCts = 1,
                       cts = "counts")

markPAI(data = data1m, cts = 'counts')[1:10,]

PhysicalActivity documentation built on Jan. 23, 2021, 1:06 a.m.