wear_flag {ActFrag}R Documentation

Create Wear/Nonwear Flags

Description

Determine during which time period, subject should wear the device. It is preferable that user provide their own wear/non wear flag which should has the same dimension as the activity data. This function provide wear/non wear flag based on time of day.

Usage

wear_flag(count.data, start = "05:00", end = "23:00")

Arguments

count.data

data.frame of dimension n*1442 containing the 1440 minute activity data for all n subject days. The first two columns have to be ID and Day.

start

start time, a string in the format of 24hr, e.g. "05:00"; defaults to "05:00".

end

end time, a string in the format of 24hr, e.g. "23:00"; defaults to "23:00"

Details

Fragmentation metrics are usually defined when subject is awake. The weartime provide time periods on which those features should be extracted. This can be also used as indication of wake/sleep.

Value

A data.frame with same dimension and column name as the count.data, with 0/1 as the elments reprensting wear, nonwear respectively.

Examples

data(example_activity_data)
count = example_activity_data$count
weartime = wear_flag(count.data = count)




[Package ActFrag version 0.1.1 Index]