plotData: Plot Accelerometer Data over Time

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

View source: R/plotData.R

Description

This function makes plot for accelerometer collected data (counts) over time for the whole monitor period, or a user specified time period or day with a midnight marking to separate monitored days.

Usage

1
2
3
4
5
6
7
8
9
plotData(
  data,
  day = NULL,
  start = NULL,
  end = NULL,
  cts = getOption("pa.cts"),
  TS = getOption("pa.timeStamp"),
  summary = NULL
)

Arguments

data

Data with classified wear and nonwear status from wearingMarking.

day

A part of data during a user specified day for plot.

start

Define a starting time for plot.

end

Define a ending time for plot.

cts

The name of the counts column. The default is "axis1".

TS

The column name for timestamp. The default is "TimeStamp".

summary

List output of summaryData function.

Details

If a local time-zone is specified for wearkingMarking, it is possible that daylight savings starts or ends during the period shown. In this case a dotted line will indicate its position and the appropriate time-zone abbreviations will be included.

Value

Plot with midnight marking.

Author(s)

Leena Choi leena.choi@Vanderbilt.Edu

See Also

wearingMarking, sumVct, summaryData

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
data(dataSec)

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

data1m = wearingMarking(dataset = mydata1m,
                       frame = 90, 
                       perMinuteCts = 1,
                       TS = "TimeStamp",
                       cts = "counts", 
                       streamFrame = NULL, 
                       allowanceFrame= 2, 
                       newcolname = "wearing")

## change "cts" default from "axis1" to "counts"
options(pa.cts = "counts")
## plot the whole data
plotData(data=data1m)

## plot the data from 60 min to 900 min
plotData(data=data1m, start=60, end=900)

## plot the data for day 2
plotData(data=data1m, day=2)

## include summaryData
sumdat <- summaryData(data=data1m)
plotData(data=data1m, summary=sumdat)

## present daylight saving time change
data(deliveryData)
options(pa.cts = "vm")
wm <- wearingMarking(dataset = deliveryData, TS="TimeStamp", tz="America/Chicago")
sumdat <- summaryData(wm)
plotData(data=wm, summary = sumdat)
## valid data after delivery marking
del <- markDelivery(wm)
sumdat <- summaryData(wm, delivery = del)
plotData(data=wm, summary = sumdat)

Example output



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