ggir.datatransform {mMARCH.AC}R Documentation

Transform the data and merge all accelerometer files in the GGIR output

Description

An accelerometer file was transformed into wide data matrix, in which the rows represent available days and the columns including all timestamps for 24 hours. Further, the wide data was merged together.

Usage

ggir.datatransform(
  outputdir,
  subdir,
  studyname,
  numericID = FALSE,
  sortByid = "newID",
  f0 = 1,
  f1 = 1e+06,
  epochIn = 5,
  epochOut = 5,
  DoubleHour = c("average", "earlier", "later"),
  mergeVar = 1
)

Arguments

outputdir

character Directory where the GGIR output was stored.

subdir

character Sub-directory where the summary output was stored under the current directory. Defaut is "data".

studyname

character Specify the study name that used in the output file names

numericID

logical Specify if the ID is numeric when checking ID errors in module2. Default is FALSE.

sortByid

character Specify the name of "ID" for each accelerometer file in the report of module5. The value could be "newID","id" and "filename". Defaut is "filename".

f0

number File index to start with (default = 1). Index refers to the filenames sorted in increasing order.

f1

number File index to finish with. Note that file ends with the minimum of f1 and the number of files available. Default = 1000000.

epochIn

number Epoch size to which acceleration was averaged (seconds) in GGIR output. Defaut is 5 seconds.

epochOut

number Epoch size to which acceleration was averaged (seconds) in module1. Defaut is 600 seconds.

DoubleHour

character Specify the method of processing the double hours for days that daylight saving time starts and ends for example. In detail, DoubleHour = c("average","earlier","later"). The acceleration data was averaged on double hours when DoulbeHour="average". Only the acceleration data in the earlier occurrence was remained for double hours while the other duplicate data were ignored when DoulbeHour="earlier". Only the acceleration data in the later occurrence was remained for double hours while the other duplicate data were ignored when DoulbeHour="later". Default is "average".

mergeVar

number Specify which of the varaible need to be processed and merged. For example, mergeVar = 1 makes that the M$metalong varialbes were read from R data on the directory of /meta/basic under GGIR ourput directory, which includes "nonwearscore","clippingscore","lightmean","lightpeak","temperaturemean" and "EN". When mergeVar = 2, makes that the "enmo" and "anglez" varialbes were read from csv data on the directory of /meta/csv under GGIR ourput directory.

Value

mergeVar = 1

Six files were written to the specified sub-directory as follows,

nonwearscore_studyname_f0_f1_Xs.xlsx

Data matrix of nonwearscore, where f0 and f1 are the file index to start and finish with and Xs is the epoch size to which acceleration was averaged (seconds) in GGIR output.

clippingscore_studyname_f0_f1_Xs.xlsx

Data matrix of clippingscore

lightmean_studyname_f0_f1_Xs.xlsx

Data matrix of lightmean

lightpeak_studyname_f0_f1_Xs.xlsx

Data matrix of lightpeak

temperaturemean_studyname_f0_f1_Xs.xlsx

Data matrix of temperaturemean

EN_studyname_f0_f1_Xs.xlsx

Data matrix of EN

mergeVar = 2

Two files were written to the specified sub-directory as follows,

studyname_ENMO.dataf0_f1_Xs.xlsx

Data matrix of ENMO, where f0 and f1 are the file index to start and finish with and Xs is the epoch size to which acceleration was averaged (seconds) in GGIR output.

studyname_ANGLEZ.dataf0_f1_Xs.xlsx

Data matrix of ANGLEZ


[Package mMARCH.AC version 2.9.2.0 Index]