Learn R Programming

GGIR (version 2.3-0)

g.readaccfile: Generic functiont to read large blocks of accelerometer data

Description

The function is used by g.getmeta and g.calibrate to read large blocks of the accelerometer file, which are processed and then deleted. This is needed for memory management.

Usage

g.readaccfile(filename,blocksize,blocknumber,
  selectdaysfile=c(),filequality, decn,dayborder,ws,desiredtz="",
  PreviousEndPage=1,inspectfileobject=c(),configtz=c(), ...)

Arguments

filename

filename

blocksize

Size of blocks (in file pages) to be read

blocknumber

Block number relative to start of file

selectdaysfile

See documentation g.getmeta

filequality

Single row dataframe with columns: filetooshort, filecorrupt, and filedoesnotholdday. All with the value TRUE or FALSE

decn

Character with a dot or a comma, used for interpretting samplefrequency in the file header. decn is derived with g.dotorcomma

dayborder

See documentation g.part1

ws

Larger windowsize for non-detection, see documentation g.part2

desiredtz

Desired timezone, see documentation g.getmeta

PreviousEndPage

Page number on which previous block ended (automatically assigned within g.getmeta and g.calibrate).

inspectfileobject

Output from the function g.inspectfile.

configtz

Only functional for AX3 cwa data at the moment. Timezone in which the accelerometer was configured. Only use this argument if the timezone of configuration and timezone in which recording took place are different.

...

Any input arguments needed for function read.myacc.csv if you are working with a non-standard csv formatted files.

Value

P=P,filequality=filequality, switchoffLD = switchoffLD

  • P Block object extracted from file with format specific to accelerometer brand

  • filequality Same as in function arguments

  • switchoffLD Boolean to indicate whether it is worth continueing to read the next block of data or not

  • endpage Page number on which blocked ends, this will be used as input for argument PreviousEndPage when reading the next block.

Examples

Run this code
# NOT RUN {
filequality = data.frame(filetooshort=FALSE, filecorrupt=FALSE,
filedoesnotholdday = FALSE)
output = g.readaccfile(filename="C:/myfile.bin", 
locksize=20000, blocknumber=1,
selectdaysfile=c(), filequality=filequality,
                         decn=".", dayborder=0,PreviousEndPage=c()) 
# }

Run the code above in your browser using DataLab