Learn R Programming

Getting started:

The package documentation provides extensive documentation on GGIR and its functionalities.

Getting help:

For guidance on how to seek help see this page.

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.

Copy Link

Version

Install

install.packages('GGIR')

Monthly Downloads

1,197

Version

3.3-9

License

Apache License (== 2.0) | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Vincent T van Hees

Last Published

September 12th, 2026

Functions in GGIR (3.3-9)

check_myfun

Checks myfun object before it is passed to applyExtfunction
check_log

Function to revise format of user-provided logs
extract_params

Extract parameters from input and add them to params
create_test_acc_csv

Creates csv data file for testing purposes
apply_cosinor_IS_IV_Analyses

Apply Cosinor Analyses to time series
detect_nonwear_clipping

Detect non-wear and clipping time in the raw accelerometer data
ShellDoc2Vignette

Extract Definition from Shell Documentation
createConfigFile

Creates Config File based on variables in function GGIR environment
extractID

Extract ID from file header object
addSplitNames

Add split names to output object in g.part4 and g.part5
applyExtFunction

Apply external function to acceleration data.
checkMilestoneFolders

Checks for existence of folders to process
build_epoch_table

Build a flat epoch table from ms5.outraw time series
data.getmeta

Example output from g.getmeta
datadir2fnames

Generates vector of file names out of datadir input argument
GGIR

Shell function for analysing an accelerometer dataset.
data.inspectfile

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

Convert part 2 report to long format
g.create.sp.mat

Converts sleep period information. Not intended for direct use
aggregateEvent

Aggregates event data as produced by external function
cosinor_IS_IV_Analyses

Apply cosinor anlaysis and extended cosinor analysis
correctOlderMilestoneData

Corrects milestone data from g.part1 generated in older GGIR versions
g.fragmentation

Fragmentation metrics from time series.
g.extractheadervars

Extracts header variables from header object
filterNonwearNight

Filters short lasting nonwear during the night
g.analyse.perfile

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

Extract metrics from acceleration signals
HASIB

Heuristic algorithms for sustiained inactivty bouts detection
appendRecords

Append GGIR milestone data from neighbouring or overlapping recordings
g.report.part4

Generate report from milestone data produced by g.part4
g.inspectfile

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

Generate report from milestone data produced by g.part2
g.part5.lux_persegment

Extract key lux variables per segment of the data.
check_params

Check default parameters
g.intensitygradient

Intensity gradient calculation
g.part5.handle_lux_extremes

Check lux values for extremes and imputes or removes them
data.metalong

Metalong object as part of part 1 milestone data
data.ts

Time series data.frame stored by part 5
g.IVIS

Calculates IV and IS
g.calibrate

function to estimate calibration error and make recommendation for addressing it
convertEpochData

convert external Epoch data to GGIR part 1 milestone data format
g.detecmidnight

Detect all midnights in a time series
g.conv.actlog

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

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

Assesses whether decimals in fileheader are stored with comma or dot separated decimals
g.part5.addfirstwake

Adds first wake if it is missing in part 4 output.
create_test_sleeplog_csv

Creates csv sleeplog file for testing purposes
g.part5.onsetwaketiming

Identify wake and sleepperiod window timing
g.getM5L5

Extract M5 and L5 from time series
data.calibrate

Example output from g.calibrate
g.analyse

Function to analsyse meta-data generated by g.getmeta and g.impute
g.abr.day.names

Abbreviates daynames to numbers, needed for report generation in g.plot5
g.getbout

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

Perform temporal pattern analyses
g.part5_initialise_ts

Initialise time series data from for part 5
g.part5.savetimeseries

Saves part 5 time series to csv files
g.part3_alignIndexVectors

Aligns index vectors used inside g.part3_correct_guider
g.part4

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

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

Extract start time of a measurement
g.report.part6

Generate report from milestone data produced by g.part6
g.shell.GGIR

Wrapper function around function GGIR
markerButtonForRest

Improve the labelling of rest with marker button data
iso8601chartime2POSIX

Convert iso8601 timestamps to POSIX timestamp
load_params

Load default parameters
g.analyse.avy

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

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

Extracts ID from filename and finds matching rows in sleeplog
g.part5.wakesleepwindows

Label wake and sleepperiod window
g.part5.addsib

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

Analyse rest (internal function)
g.report.part5_dictionary

Generate data dictionary for reports from milestone data produced by g.part5
g.report.part5

Generate report from milestone data produced by g.part5
inspect_binFile_brand

Identify the Device Brand from a Binary File
get_nw_clip_block_params

Set monitor brand specific parameters
identify_levels

Identifies levels of behaviour for g.part5 function.
getSplitNames

get split names from filename
g.part5_analyseSegment

Analyses the time series per time segment for part 5
parametersVignette

Builds Section for Parameters Vignette
g.part3_correct_guider

Correct guider estimates
g.sib.det

sustiained inactivty bouts detection
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.loadlog

Load and clean sleeplog information
g.part1

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

Impute gaps in three axis raw accelerometer data
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.weardec

Detects whether accelerometer is worn
getPart1BasicInfo

Get basic info form the part 1 milestone file
g.plot

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

function to analyse and summarize pre-processed output from g.part1
g.part5.fixmissingnight

Fix missing night in part 4 output
g.part3

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

sustiained inactivty bouts detection
g.readaccfile

Generic functiont to read large blocks of accelerometer data
g.part5.definedays

Fix missing night in part 4 output
visualReport

Generate visualisation of time series produced by part 5.
g.readtemp_movisens

Reads the temperature from movisens files.
read.myacc.csv

Read custom csv files with accelerometer data
part6AlignIndividuals

part6AlignIndividuals
get_starttime_weekday_truncdata

Get starttime (adjusted), weekday, and adjust data accordingly.
g.sibreport

Generate sustiained inactivty bouts report
ismovisens

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

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

Extracts folderstructure based on data directory.
tidyup_df

Round numeric columns and replace NA/NaN values by blank
is.ISO8601

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

Create plot of sustained inactivity bouts
write_epoch_parquet

Write flat epoch-level Parquet output
splitRecords

Append GGIR milestone data from neighbouring or overlapping recordings
write_dashboard_parquet

Write consolidated dashboard Parquet output
updateBlocksize

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

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

part6PairwiseAggregation
ABI

Activity balance index (ABI)
MXLX

MX LX analysis
SSP

Estimated self-similarity parameter
DFA

Detrended Fluctuation Analysis
POSIXtime2iso8601

Convert POSIX to iso8601 timestamp
GGIR-package

A package to process multi-day raw accelerometer data
CalcSleepRegularityIndex

Calculates Sleep Regularity Index
HASPT

Heuristic Algorithms estimating SPT window.