Learn R Programming

⚠️There's a newer version (3.2-0) of this package.Take me there.

Getting started:

The package vignette and this short tutorial video provide an introduction to GGIR, including: How it can be installed, Key software features, and where to get help.

Contribution guidelines:

We always welcome contributions to the package. If you want to contribute to the development of GGIR, have a look at the contribution guidelines.

Images usaged

The copyright of the GGIR logo as contained in the file vignettes/GGIR-MASTERLOGO-RGB.png lies with Accelting (Almere, The Netherlands), please contact v.vanhees@accelting.com to ask for permission to use this logo.

All other images in this repository are released under the Creative Commons Attribution 4.0 International (CC BY 4.0) license.

Research notice

Please note that this repository is participating in a study into sustainability of open source projects. Data will be gathered about this repository for approximately the next 12 months, starting from June 2021.

Data collected will include number of contributors, number of PRs, time taken to close/merge these PRs, and issues closed.

For more information, please visit the informational page or download the participant information sheet.

Copy Link

Version

Install

install.packages('GGIR')

Monthly Downloads

1,775

Version

2.6-0

License

LGPL (>= 2.0, < 3) | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Vincent T van Hees

Last Published

February 2nd, 2022

Functions in GGIR (2.6-0)

create_test_acc_csv

Creates csv data file for testing purposes
extract_params

Extract parameters from input and add them to params
GGIR-package

A package to process multi-day raw accelerometer data
g.IVIS

Calculates IV and IS
data.getmeta

Example output from g.getmeta
g.applymetrics

Extract metrics from acceleration signals
g.analyse.perfile

Function supports g.analyse. Not intended for direct use by user.
g.conv.actlog

Function to read activity log and make it useful for the rest of GGIR.
g.analyse

g.abr.day.names

data.calibrate

Example output from g.calibrate
g.convert.part2.long

Convert part 2 report to long format
g.binread

function to read binary files as produced by the accelerometer named 'Genea', not to be confused with the 'GENEActiv' (see package GENEAread for this)
data.inspectfile

Example output from g.inspectfile
g.getidfromheaderobject

Extracts participant identifier from header object
datadir2fnames

Generates vector of file names out of datadir input argument
create_test_sleeplog_csv

Creates csv sleeplog file for testing purposes
g.cwaread

Function to read .cwa-format files as produced by the accelerometer named 'Axivity'
g.intensitygradient

Intensity gradient calculation
g.loadlog

Load and clean sleeplog information
g.getmeta

Function to extract meta-data (features) from data in accelerometer file
g.getM5L5

Extract M5 and L5 from time series
g.getbout

function to calculate bouts from vector of binary classes
g.createcoordinates

g.create.sp.mat

Converts sleep period information. Not intended for direct use
g.part3

Detection of sustained inactivity periods as needed for sleep detection in g.part4.
g.part5.fixmissingnight

Fix missing night in part 4 output
g.part4

Labels detected sustained inactivity periods by g.part3 as either part of the Sleep Period Time window or not
g.part5.handle_lux_extremes

Check lux values for extremes and imputes or removes them
g.inspectfile

function to inspect accelerometer file for brand, sample frequency and header
g.imputeTimegaps

Impute gaps in three axis raw accelerometer data
g.part5.classifyNaps

Classify Naps from identified sustained inactivty bouts
g.part5.definedays

Fix missing night in part 4 output
g.calibrate

function to estimate calibration error and make recommendation for addressing it
g.part5.addsib

Adds the sustained inactivity bout to the ts series.
g.part5.addfirstwake

Adds first wake if it is missing in part 4 output.
g.report.part2

g.extractheadervars

Extracts header variables from header object
g.readaccfile

Generic functiont to read large blocks of accelerometer data
g.impute

Function to identify invalid periods in the meta-data as generated by g.getmeta and to impute these invalid periods with the average of similar timepoints on other days of the measurement
g.detecmidnight

Detect all midnights in a time series
g.getstarttime

Extract start time of a measurement
g.sib.det

sustiained inactivty bouts detection
g.readtemp_movisens

Reads the temperature from movisens files.
g.sib.plot

Create plot of sustained inactivity bouts
getStartEndNumeric

Generate start and end page of a day
load_params

Load default parameters
numUnpack

Simple function using Rcpp
read.myacc.csv

Read custom csv files with accelerometer data
g.analyse.avy

Function supports g.analyse. Not intended for direct use by user.
getFirstTimestamp

Extract first timestamp from GENEActiv file
get_nw_clip_block_params

Set monitor brand specific parameters
g.report.part4

is_this_a_dst_night

Check whether the night starting on a calendar date has DST.
resample

Simple function using Rcpp
g.part4_extractid

Extracts ID from filename and finds matching rows in sleeplog
isfilelist

Checks whether datadir is a directory or a vector with filenames
getStartEnd

Generate start and end time of a day
g.part5.savetimeseries

Saves oart 5 time series to csv files
g.fragmentation

Fragmentation metrics from time series.
g.part5.wakesleepwindows

Label wake and sleepperiod window
g.analyse.perday

Function supports g.analyse. Not intended for direct use by user.
get_starttime_weekday_meantemp_truncdata

Get starttime (adjusted), weekday, mean temp, and adjust data accordingly.
g.wavread

function to read .wav files as produced by the accelerometer named 'Axivity'
g.part5

Merge output from physical activity and sleep analysis into one report
g.plot5

Generate user-friendly visual report. The first part of the report summarizes important daily metrics in bar plot format. The second part of the report shows the raw data and annotations in 24-hr periods. Angle-z is shown with sleep annotations during the SPT (sleep period time) window. ENMO is shown with daytime inactivity and PA (physical activity) annotations in the lower section of each 24-hr plot. The PA annotations are based on a 10 minute bout metric and 80 of a 10 minute bout of MVPA. Vigorous PA is a short window of time above threshold.vig that is part of a bout of MVPA. Light PA is a short window of time above threshold.lig that is part of a bout of light PA.
g.sibreport

Generate sustiained inactivty bouts report
g.plot

function to generate a plot for quality check purposes
g.weardec

Detects whether accelerometer is worn
identify_levels

Identifies levels of behaviour for g.part5 function.
is.ISO8601

Check whether character timestamp is in iso8601 format.
g.sib.sum

sustiained inactivty bouts detection
g.dotorcomma

Assesses whether decimals in fileheader are stored with comma or dot separated decimals
updateBlocksize

Update blocksize of data to be read depending on available memory.
getfolderstructure

Extracts folderstructure based on data directory.
parseGT3Xggir

Parse activity samples from a GT3X file with batch loading
g.part5.lux_persegment

Extract key lux variables per segment of the data.
g.part1

function to load and pre-process acceleration files
g.downsample

Downsample a vector of numeric values at three time resolutions
g.part2

g.part5.onsetwaketiming

Identify wake and sleepperiod window timing
ismovisens

Checks whether the files to process are collected with movisens accelerometers.
g.shell.GGIR

Shell function for analysing an accelerometer dataset.
g.report.part5

iso8601chartime2POSIX

Convert iso8601 timestamps to POSIX timestamp
read.gt3x_ggir

Read GT3X
CalcSleepRegularityIndex

Calculates Sleep Regularity Index
chartime2iso8601

Convert character timestamps to iso8601 timestamp
POSIXtime2iso8601

Convert POSIX to iso8601 timestamp
check_params

Check default parameters
createConfigFile

Creates Config File based on variables in g.shell.GGIR environment
HASIB

Heuristic algorithms for sustiained inactivty bouts detection
check_myfun

Checks myfun object before it is passed to applyExtfunction
applyExtFunction

Apply external function to acceleration data.
HASPT

Heuristic Algorithms estimating SPT window.