Learn R Programming

PhysicalActivity (version 0.2-4)

readActigraph: Read ActiGraph Accelerometer Data

Description

This function reads an ActiGraph AGD file into R as a data frame. If accelerometer data are collected with three axes, it creates vector magnitude (vm). The counts at any axis or "vm" can be used to classify with wear and nonwear time using wearingMarking.

Usage

readActigraph(datfile, convertTime = TRUE)

Arguments

datfile

An AGD file.

convertTime

Convert the timestamp from a character string into POSIXct.

Value

A data frame with accelerometer data.

Details

AGD files are SQLite databases. This function requires the RSQLite package.

See Also

wearingMarking, queryActigraph

Examples

Run this code
# NOT RUN {
dat <- readActigraph("actfile.agd")
dat1s <- wearingMarking(dataset = dat,
                       frame = 90,
                       perMinuteCts = 1,
                       TS = "TimeStamp",
                       cts = "axis1",
                       streamFrame = NULL,
                       allowanceFrame= 2,
                       newcolname = "wearing",
                       getMinuteMarking = FALSE)
# }

Run the code above in your browser using DataLab