dateSummary: Date summary for accelerometer files

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function provides a date summary for Actigraph GT1M accelerometer files.

Usage

1
2
dateSummary(object, wear, timestamp, minval = 0,
rescale.epoch = 60, keep.error = FALSE)

Arguments

object

an object of class gt1m.

wear

a vector that classifies wear and non-wear time. See markwear.accfile.

timestamp

a timestamp vector for accelerometer values that can be provided by tsFormat.

minval

threshold defining the minimum number of minutes to identify first and last days. See details.

rescale.epoch

epoch expressed in the same unit as acceleromenter's epoch to determine minutes of wear time (default is 60 and assumed to be in seconds).

keep.error

logical flag. If FALSE (default) data errors as identified by errorChk will be replaced by NAs.

Details

Based on total wear time (in minutes) for each day, the theshold minval is applied to identify the first and last days. For example, if accelerometers are sent by post to collect survey data, the first and last days in which the accelerometer was worn might not be known. Days before the first and those after the last day (truncated days) are discarded by collapse.accfile.

Value

A data frame containing the following variables

fileid

file identifier

days

dates by calendar day

freq

frequency of accelerometer observations in each day

hour_day

total hours of accelerometer observations in each day

start_day

starting time of accelerometer observations

end

end time of accelerometer observations

valid_mins

wear time (minutes)

IsStartDate

dummy variable to define starting date (1 = yes)

IsEndDate

dummy variable to define end date (1 = yes)

IsTruncated

dummy variable to define truncated date (1 = yes)

Author(s)

Marco Geraci

References

Geraci M, Rich C, Sera F, Cortina-Borja M, Griffiths LJ, and Dezateux C (2012). Technical report on accelerometry data processing in the Millennium Cohort Study. London, UK: University College London. Available at http://discovery.ucl.ac.uk/1361699

See Also

collapse.accfile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
data(gt1m_sample)

mw <- markwear.accfile(gt1m_sample, 20)
tsf <- tsFormat(gt1m_sample)
dateSummary(gt1m_sample, mw, tsf)
## Not run: 
  fileid       days freq hour_day start_day end_day valid_mins IsStartDate
1   test 2011-12-08 3840   16.000        08      23     571.25           1
2   test 2011-12-09 5760   24.000        00      23     557.00           0
3   test 2011-12-10 5760   24.000        00      23     676.50           0
4   test 2011-12-11 5760   24.000        00      23     493.50           0
5   test 2011-12-12 5760   24.000        00      23     638.25           0
6   test 2011-12-13 5760   24.000        00      23     680.50           0
7   test 2011-12-14 5760   24.000        00      23     717.00           0
8   test 2011-12-15 5760   24.000        00      23       0.50           0
9   test 2011-12-16  750    3.125        00      03       0.00           0
  IsEndDate IsTruncated
1         0           0
2         0           0
3         0           0
4         0           0
5         0           0
6         0           0
7         0           0
8         0           0
9         1           0

## End(Not run)

# at least 600 minutes per day to determine first and last day
dateSummary(gt1m_sample, mw, tsf, minval = 600)
## Not run: 
  fileid       days freq hour_day start_day end_day valid_mins IsStartDate
1   test 2011-12-08 3840   16.000        08      23     571.25           0
2   test 2011-12-09 5760   24.000        00      23     557.00           0
3   test 2011-12-10 5760   24.000        00      23     676.50           1
4   test 2011-12-11 5760   24.000        00      23     493.50           0
5   test 2011-12-12 5760   24.000        00      23     638.25           0
6   test 2011-12-13 5760   24.000        00      23     680.50           0
7   test 2011-12-14 5760   24.000        00      23     717.00           0
8   test 2011-12-15 5760   24.000        00      23       0.50           0
9   test 2011-12-16  750    3.125        00      03       0.00           0
  IsEndDate IsTruncated
1         0           1
2         0           1
3         0           0
4         0           0
5         0           0
6         0           0
7         1           0
8         0           1
9         0           1

## End(Not run)

pawacc documentation built on May 2, 2019, 5:12 a.m.