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.

When you are familiar with GitHub:

We work with GitHub Flow branching model.

Key steps:

  1. Create a GitHub issue in this repository with description of the work that you plan to do.
  2. Assign yourself to the GitHub issue you are working on, to inform other developers that you are working on it.
  3. Create your own working branch or fork.
  4. Make your changes in that branch or fork.
  5. Commit your changes to your working branch/fork as long as you are not finished with your development.
  6. Make sure the release notes in NEWS.Rd are updated.
  7. Add your name to the contributors list in the DESCRIPTION file.
  8. Run the tests and checks as CRAN, make sure they pass.
  9. Once your work is finished, make a pull request, such that another developer can review your changes before merging them with the master branch.

When you are unfamiliar with GitHub:

If you would like to propose additional functionalities or report an issue. Go to issues and create a new issue.

If you would like to propose changes to the text of the manual this is possible.

  1. Please go to the man folder which holds all the parts of the manual.
  2. Go to the part of the manual you want to edit and click on edit button (little pencil symbol) and make your changes.
  3. Once you are finished, scroll down and describe you update and select the radio button "Create a new branch for this commit and start a pull request". One of the developers will then be able to review your changes and merge them in the master version of the code.
  4. Click the green button "Propose file changes"

Version numbers:

For a number of years I created a new GGIR release on CRAN with every major improvement to GGIR. This resulted in 18 releases in just two years, which is not very practical.

As of 2020 I am reducing the number of CRAN releases to only two or three per year, with intermediate releases on GitHub only. New features and bug fixes will first be released on GitHub, which creates a time window for extra testing before they end up in the next CRAN release. This will make the GGIR CRAN releases more stable and a good starting point for new GGIR users, while GitHub releases will become the place for the latest bug fixes and feature additions.

If possible, please use the GitHub version whenever you can to help spot issues timely before they end up in a CRAN release.

With this new release structure I will use the following version coding. A.B-C:

  • A increases with major changes that affect backward compatibility with previous releases like changes in function names, function arguments or file format.
  • B increases with every CRAN release.
  • C increases with every GitHub release.

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.

Copy Link

Version

Install

install.packages('GGIR')

Monthly Downloads

1,775

Version

2.4-0

License

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

Issues

Pull Requests

Stars

Forks

Maintainer

Vincent T van Hees

Last Published

June 3rd, 2021

Functions in GGIR (2.4-0)

g.downsample

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

Extracts header variables from header object
g.part5.definedays

Fix missing night in part 4 output
g.part5.addsib

Adds the sustained inactivity bout to the ts series.
g.fragmentation

Fragmentation metrics from time series.
g.readaccfile

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

Reads the temperature from movisens files.
g.weardec

Detects whether accelerometer is worn
getFirstTimestamp

Extract first timestamp from GENEActiv file
applyExtFunction

Apply external function to acceleration data.
chartime2iso8601

Convert character timestamps to iso8601 timestamp
check_myfun

Checks myfun object before it is passed to applyExtfunction
createConfigFile

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

Example output from g.inspectfile
getStartEnd

Generate start and end time of a day
getStartEndNumeric

Generate start and end page of a day
updateBlocksize

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

Separate gravity from acceleration signal.
g.analyse.perday

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

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

Generates vector of file names out of datadir input argument
g.create.sp.mat

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

g.getM5L5

Extract M5 and L5 from time series
g.getbout

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

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

Load and clean sleeplog information
g.metric

Extract metrics from acceleration signals
g.part5.wakesleepwindows

Label wake and sleepperiod window
g.part5.savetimeseries

Saves oart 5 time series to csv files
get_starttime_weekday_meantemp_truncdata

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

Set monitor brand specific parameters
g.part4

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

function to generate a plot for quality check purposes
is_this_a_dst_night

Check whether the night starting on a calendar date has DST.
g.report.part4

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.
is.ISO8601

Check whether character timestamp is in iso8601 format.
g.report.part2

iso8601chartime2POSIX

Convert iso8601 timestamps to POSIX timestamp
numUnpack

Simple function using Rcpp
data.calibrate

Example output from g.calibrate
data.getmeta

Example output from g.getmeta
g.applymetrics

Extract metrics from acceleration signals
g.applymetrics4sg

Apply metrics specific for data coming out of separategravity function
g.calibrate

function to estimate calibration error and make recommendation for addressing it
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)
g.getstarttime

Extract start time of a measurement
create_test_acc_csv

Creates csv data file for testing purposes
create_test_sleeplog_csv

Creates csv sleeplog file for testing purposes
g.IVIS

Calculates IV and IS
g.abr.day.names

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.part2

g.part1

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

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

sustiained inactivty bouts detection
g.cwaread

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

Convert POSIX to iso8601 timestamp
GGIR-package

A package to process multi-day raw accelerometer data
isfilelist

Checks whether datadir is a directory or a vector with filenames
g.getidfromheaderobject

Extracts participant identifier from header object
g.detecmidnight

Detect all midnights in a time series
g.getmeta

function to extract meta-data (features) from data in accelerometer file
g.part5.fixmissingnight

Fix missing night in part 4 output
g.part5.handle_lux_extremes

Check lux values for extremes and imputes or removes them
g.convert.part2.long

Convert part 2 report to long format
g.conv.actlog

Function to read activity log and make it useful for the rest of GGIR.
read.myacc.csv

Read custom csv files with accelerometer data
resample

Simple function using Rcpp
ismovisens

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

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

Intensity gradient calculation
g.sib.det

sustiained inactivty bouts detection
g.sib.plot

Create plot of sustained inactivity bouts
g.part5

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

Adds first wake if it is missing in part 4 output.
g.part5.onsetwaketiming

Identify wake and sleepperiod window timing
g.part5.lux_persegment

Extract key lux variables per segment of the data.
g.report.part5

g.shell.GGIR

Shell function for analysing an accelerometer dataset.
getfolderstructure

Extracts folderstructure based on data directory.
identify_levels

Identifies levels of behaviour for g.part5 function.
g.analyse

g.analyse.avy

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

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