Learn R Programming

accelerometry (version 3.1.2)

cut_counts: Cut Count Values into Intensity Ranges

Description

Given a vector of accelerometer count values, classifies each count value into intensity level 1, 2, 3, 4, or 5 (typically representing sedentary, light, lifestyle, moderate, and vigorous).

Usage

cut_counts(counts, int_cuts = as.integer(c(100, 760, 2020, 5999)))

Arguments

counts

Integer vector with accelerometer count values.

int_cuts

Numeric vector with four cutpoints from which five intensity ranges are derived. For example, int_cuts = c(100, 760, 2020, 5999) creates: 0-99 = intensity 1; 100-759 = intensity level 2; 760-2019 = intensity 3; 2020-5998 = intensity 4; >= 5999 = intensity 5.

Value

Integer vector.

Examples

Run this code
# NOT RUN {
# Load accelerometer data for first 5 participants in NHANES 2003-2004
data(unidata)

# Get data from ID number 21005
counts.part1 <- unidata[unidata[, "seqn"] == 21005, "paxinten"]

# Cut into 5 intensity levels and plot
intensity.part1 <- cut_counts(counts = counts.part1)
plot(intensity.part1)


# }

Run the code above in your browser using DataLab