Package 'nparACT'

Title: Non-Parametric Measures of Actigraphy Data
Description: Computes interdaily stability (IS), intradaily variability (IV) & the relative amplitude (RA) from actigraphy data as described in Blume et al. (2016) <doi: 10.1016/j.mex.2016.05.006> and van Someren et al. (1999) <doi: 10.3109/07420529908998724>. Additionally, it also computes L5 (i.e. the 5 hours with lowest average actigraphy amplitude) and M10 (the 10 hours with highest average amplitude) as well as the respective start times. The flex versions will also compute the L-value for a user-defined number of minutes. IS describes the strength of coupling of a rhythm to supposedly stable zeitgebers. It varies between 0 (Gaussian Noise) and 1 for perfect IS. IV describes the fragmentation of a rhythm, i.e. the frequency and extent of transitions between rest and activity. It is near 0 for a perfect sine wave, about 2 for Gaussian noise and may be even higher when a definite ultradian period of about 2 hrs is present. RA is the relative amplitude of a rhythm. Note that to obtain reliable results, actigraphy data should cover a reasonable number of days.
Authors: Christine Blume <[email protected]> Nayantara Santhi <[email protected]> Manuel Schabus <[email protected]>
Maintainer: Christine Blume <[email protected]>
License: GPL-2
Version: 0.8
Built: 2025-03-09 05:11:15 UTC
Source: https://github.com/christineblume/nparact

Help Index


Non-Parametric Measures of Actigraphy Data

Description

Computes interdaily stability (IS), intradaily variability (IV) and the relative amplitude (RA) from actigraphy data for single or multiple actigraphy files as described in van Someren et al. (1999). Additionally, it also computes the L5 (i.e. the 5 hours with lowest average actigraphy amplitude) and M10 (the 10 hours with highest average amplitude) values as well as the respective start times. The flex versions will also compute the L-value for a user-defined number of minutes. IS describes the strength of coupling of a rhythm to supposedly stable zeitgebers such as sunlight. It varies between 0 (Gaussian Noise) and 1 for perfect IS. IV describes the fragmentation of a rhythm, i.e. the frequency and extent of transitions between rest and activity. It is near 0 for a perfect sine wave, about 2 for Gaussian noise and may be even higher when a definite ultradian period of about 2 hrs is present. RA is the relative amplitude of a rhythm. Note that to obtain reliable results, actigraphy data should cover a reasonable number of days.

Details

Package: nparACT
Type: Package
Version: 0.8
Date: 2017-12-19

Author(s)

Christine Blume <[email protected]> Nayantara Santhi <[email protected]> Manuel Schabus <[email protected]>

References

Blume C., Santhi N., Schabus M. (2016). "nparACT" package for R: A free software tool for the non-parametric analysis of actigraphy data. MethodsX 3: 430-435. <doi:10.1016/j.mex.2016.05.006> van Someren E.J., Swaab D.F., Colenda C.C., Cohen W., McCall W.V., Rosenquist P.B. (1999). Bright Light Therapy - Improved sensitivity to its effects on rest-activity rhythms in alzheimer patients by application of nonparametric methods. Chronobiology International 16(4): 505-18. <doi:10.3109/07420529908998724>

Examples

# example function nparACT_base
data(sleepstudy)
r <- nparACT_base("sleepstudy", SR = 4/60)

List of Auxiliary Functions

Description

A list of auxiliary functions used in the main functions.

Usage

nparACT_auxfunctions1

List of Auxiliary Functions

Description

A list of auxiliary functions used in the main functions.

Usage

nparACT_auxfunctions2

Classic Nonparametric Actigraphy Measures for Single Actigraphy Files

Description

Function returns IS, IV, RA, L5, M10 as well as L5 and M10 start times for single actigraphy files. The function also returns a classic dual day plot for the data, a plot of minutewise averages across 24 hours as well as a plot for hourly averages across 24 hours.

Usage

nparACT_base(name, SR, cutoff = 1, plot = T, fulldays = T)

Arguments

name

Character string containing the actigraphy file name. Actigraphy files must contain a first column with a date/time vector, which must be of form YYYY-MM-DD HH:MM:SS or YYYY/MM/DD HH:MM:SS, i.e. in an unambiguous date format and a second column with actigraphy values.

SR

Sampling rate in Hz.

cutoff

Can be used to define a cutoff for actigraphy data. Default value is 1, i.e. all values are taken into account.

plot

If TRUE plots are produced. Default is TRUE.

fulldays

If TRUE only data from multiples of 24 hours (i.e. full days) are included while the rest of the data are discarded. Default is TRUE.

Value

Data frame containing IS, IV and RA values. Besides this, L5 and M10 values are given along with the respective start times.

Author(s)

Christine Blume <[email protected]> Nayantara Santhi <[email protected]> Manuel Schabus <[email protected]>


Classic Nonparametric Actigraphy Measures for Multiple Actigraphy Files

Description

Function returns IS, IV, RA, L5, M10 as well as L5 and M10 start times for multiple actigraphy files. The function also returns a plot for hourly grand averages across 24 hours.

Usage

nparACT_base_loop(path, SR, cutoff = 1, plot = T, fulldays = T)

Arguments

path

Character string containing path to location of actigraphy files. Actigraphy files must contain a first column with a date/time vector, which must be of form YYYY-MM-DD HH:MM:SS or YYYY/MM/DD HH:MM:SS, i.e. in an unambiguous date format and a second column with actigraphy values. Input files can either be text or comma separated value files.

SR

Sampling rate in Hz.

cutoff

Can be used to define a cutoff for actigraphy data. Default value is 1, i.e. all values are taken into account.

plot

If TRUE a plot is produced. Default is TRUE.

fulldays

If TRUE only data from multiples of 24 hours (i.e. full days) are included while the rest of the data are discarded. Default is TRUE.

Value

Data frame containing IS, IV and RA values for each file. Besides this, L5 and M10 values are given along with the respective start times.

Author(s)

Christine Blume <[email protected]> Nayantara Santhi <[email protected]> Manuel Schabus <[email protected]>

Examples

# example function nparACT_loop
data(sleepstudy)
name <- "sleepstudy_example"
newdir <- file.path(tempdir(),name)
dir.create(newdir, showWarnings = FALSE)
olddir <- setwd(newdir)
write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, col.names = FALSE)
r <- nparACT_base_loop(newdir, SR = 4/60)
setwd(olddir)

Extended Nonparametric Actigraphy Measures for Single Actigraphy Files

Description

Function returns IS, IV, RA, L5, M10 as well as L5 and M10 start times for single actigraphy files. Additionally, it also returns the L value (Lflex) and the start time for a specified number of minutes. The function also returns a classic dual day plot for the data, a plot of minutewise averages across 24 hours as well as a plot for hourly averages across 24 hours.

Usage

nparACT_flex(name, SR, cutoff = 1, minutes, plot = T, fulldays = T)

Arguments

name

Character string containing the actigraphy file name. Actigraphy files must contain a first column with a date/time vector, which must be of form YYYY-MM-DD HH:MM:SS or YYYY/MM/DD HH:MM:SS, i.e. in an unambiguous date format and a second column with numeric actigraphy values.

SR

Sampling rate in Hz.

cutoff

Can be used to define a cutoff for actigraphy data. Default value is 1, i.e. all values are taken into account.

minutes

Number of minutes for which the Lflex value should be computed.

plot

If TRUE plots are produced. Default is TRUE.

fulldays

If TRUE only data from multiples of 24 hours (i.e. full days) are included while the rest of the data are discarded. Default is TRUE.

Value

Data frame containing IS, IV and RA values. Besides this, L5, M10 and Lflex (for the number of minutes specified) values are given along with the respective start times.

Author(s)

Christine Blume <[email protected]> Nayantara Santhi <[email protected]> Manuel Schabus <[email protected]>

Examples

# example function nparACT
data(sleepstudy)
r <- nparACT_flex("sleepstudy", SR = 4/60, minutes = 435)

Extended Nonparametric Actigraphy Measures for Multiple Actigraphy Files

Description

Function returns IS, IV, RA, L5, M10 as well as L5 and M10 start times for single actigraphy files. Additionally, it also returns the L value (Lflex) and the start time for a specified number of minutes. The function also returns a classic dual day plot for the data, a plot of minutewise averages across 24 hours as well as a plot for hourly averages across 24 hours.

Usage

nparACT_flex_loop(path, SR, cutoff = 1, minutes, plot = T, fulldays = T)

Arguments

path

Character string containing path to location of actigraphy files. Actigraphy files must contain a first column with a date/time vector, which must be of form YYYY-MM-DD HH:MM:SS or YYYY/MM/DD HH:MM:SS, i.e. in an unambiguous date format and a second column with numeric actigraphy values. Input files can either be text or comma separated value files.

SR

Sampling rate in Hz.

cutoff

Can be used to define a cutoff for actigraphy data. Default value is 1, i.e. all values are taken into account.

minutes

Number of minutes for which the Lflex value should be computed.

plot

If TRUE a plot is produced. Default is TRUE.

fulldays

If TRUE only data from multiples of 24 hours (i.e. full days) are included while the rest of the data are discarded. Default is TRUE.

Value

Data frame containing IS, IV and RA values for each file. Besides this, L5, M10 and Lflex (for the number of minutes specified) values are given along with the respective start times.

Author(s)

Christine Blume <[email protected]> Nayantara Santhi <[email protected]> Manuel Schabus <[email protected]>

Examples

# example function nparACT_flex_loop
data(sleepstudy)
name <- "sleepstudy_example"
newdir <- file.path(tempdir(),name)
dir.create(newdir, showWarnings = FALSE)
olddir <- setwd(newdir)
write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, col.names = FALSE)
r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)
setwd(olddir)

List of Functions Computing IS and IV Values

Description

A list of auxiliary functions used in the main functions.

Usage

nparACT_ISIVfunctions

List of Functions Computing RA, L and M Values and the Respective Start Times

Description

A list of auxiliary functions used in the main functions.

Usage

nparACT_RAfunctions

Actigraphy Data from a Sleep Study

Description

Actigraphy data for a sleep study have been collected with wrist actigraphy.

Usage

data("sleepstudy")

Format

A data frame with 11520 observations on the following 2 variables.

V1

a factor with levels 2016-01-04 00:00:00 2016-01-04 00:00:15 etc.

V2

a numeric vector

Examples

data(sleepstudy)
## quick overview
head(sleepstudy)