Learn R Programming

GGIR (version 2.6-0)

g.analyse: Function to analsyse meta-data generated by g.getmeta and g.impute

Description

Analyses the output from other functions within the packages to generate a basic descriptive summary for each accelerometer data file. Analyses include: Average acceleration per day, per measurement, L5M5 analyses (assessment of the five hours with lowest acceleration and with highest acceleration). Further, the traditionally popular variable MVPA is automatically extracted in six variants: without bout criteria in combination with epoch = epoch length as defined in g.getmeta (first value of the input argument windowsizes), 1 minute, and 5 minutes, and for bout durations 1 minute, 5 minutes or 10 minutes in combination with the epoch length as defined in g.getmeta.

Usage

g.analyse(I, C, M, IMP, params_247 = c(), params_phyact = c(),
            quantiletype = 7, includedaycrit = 16, 
            idloc = 1, snloc = 1, selectdaysfile=c(), 
            dayborder=0,  desiredtz = "", myfun=c(), ...)

Arguments

I

the output from function g.inspectfile

C

the output from function g.calibrate

M

the output from function g.getmeta

IMP

the output from function g.impute

params_247
params_phyact
quantiletype

type of quantile function to use (default recommended). For details, see quantile function in STATS package

includedaycrit
idloc
snloc

If value = 1 (default) the code assumes that device serial number is stored in the obvious header field. If value = 2 the code uses the character string between the first and second character '_' in the filename as the serial number

selectdaysfile
dayborder
desiredtz
myfun

External function object to be applied to raw data, see g.getmeta.

...

Any argument used in the previous version of g.analyse, which will now be used to overrule the arguments specified with the parameter objects.

Value

g.analyse generated two data,franeL

summary

summary for the file that was analysed

daysummary

summary per day for the file that was analysed

These data.frames are used by function g.report.part2 to generate csv reports. An exaplantion of all the columns in the data.frame and subsequent csv reports can be found in the package vignette (Output part 2).

Examples

Run this code
# NOT RUN {
  data(data.getmeta)
  data(data.inspectfile)
  data(data.calibrate)
  
# }
# NOT RUN {
    #inspect file:
    I = g.inspectfile(datafile)
    
    #autocalibration:
    C = g.calibrate(datafile) 
    
    #get meta-data:
    M = g.getmeta(datafile, desiredtz = "Europe/London", 
    windowsizes = c(5, 900, 3600),
    daylimit = FALSE, offset = c(0, 0, 0), 
    scale = c(1, 1, 1), tempoffset = c(0, 0, 0))
  
# }
# NOT RUN {
  #impute meta-data:
  IMP = g.impute(M = data.getmeta, I = data.inspectfile)
  
  #analyse and produce summary:
  A = g.analyse(I = data.inspectfile, C = data.calibrate,
  M = data.getmeta, IMP)
# }

Run the code above in your browser using DataLab