frag: Fragmentation

Description Usage Arguments Value Examples

View source: R/fragmentation.R

Description

Fragmentation

Usage

1
frag(counts, weartime = NULL, thresh.lower = 100, bout.length = 1, ...)

Arguments

counts

Matrix of multiple (or 1) rows with 1440 columns.

weartime

Matrix of same dimension as counts and must consist of 1's and 0's. If unspecified, assumed to be when counts > 0.

thresh.lower

Lower cut-off for count values in intensity range. Passed to accel.bouts

bout.length

minimum length of an activity bout. Passed to accel.bouts

...

additional arguments passed to accel.bouts

Value

List of mean rest bout, mean activity bout, the total data, and the reciprocal of the bouts

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
counts = matrix(rpois(1440*5, lambda = 5), ncol = 1440)
res = frag(counts, thresh.lower = 2)

counts = example_activity_data$counts
weartime = example_activity_data$weartime
id_to_run = counts$ID[1]
counts = counts[ counts$ID == id_to_run, ]
counts$ID = counts$visit = NULL
weartime = weartime[ weartime$ID == id_to_run, ]
weartime$ID = weartime$visit = NULL

res = frag(counts, weartime = weartime, thresh.lower = 100)

muschellij2/fragmentation documentation built on May 27, 2019, 8:46 a.m.