detect_nonmovement: Detect Non-movement

View source: R/MPI_detect.R

detect_nonmovementR Documentation

Detect Non-movement

Description

Detect Non-movement

Usage

detect_nonmovement(
  binfile,
  binfile_path,
  output_folder,
  still_seconds = 120,
  sd_threshold = 0.011,
  temp_seconds = 240,
  border_seconds = 300,
  long_still_seconds = 120 * 60,
  delta_temp_threshold = -0.7,
  posture_changes_max = 2,
  non_move_duration_max = 12 * 60 * 60
)

Arguments

binfile

Text lines read from an open connection to a bin file.

binfile_path

Path to the bin file to be processed.

output_folder

Path to the folder containing GENEAcore run outputs and Measurement Period Information (MPI) files.

still_seconds

The number of seconds included in the rolling standard deviation calculation for stillness to determine the shortest detection duration.

sd_threshold

The threshold applied to the rolling standard deviation of combined acceleration to determine stillness.

temp_seconds

The number of seconds included in the rolling temperature difference calculation or non-wear which also determines the shortest detection duration.

border_seconds

The minimum number of seconds of a still event to be classed as a new bout.

long_still_seconds

The minimum number of seconds of a still bout that is classed as non-wear.

delta_temp_threshold

The threshold applied to the rolling temperature difference to determine non-wear.

posture_changes_max

The maximum number of adjoining events that make up a single bout.

non_move_duration_max

The maximum number of seconds of a still bout to be classed as non-movement. Still bouts with a duration longer than this number is automatically classed as non-wear.

Details

Function to detect non-movement bouts, non-wear events and points in a 1Hz downsampled bin file.

Value

List of sphere points, non-movement bouts and non-wear events.

Examples

binfile_path <- system.file("inst/extdata/20Hz_file.bin", package = "GENEAcore")
con <- file(binfile_path, "r")
binfile <- readLines(con, skipNul = TRUE)
close(con)
output_folder <- "."
MPI <- create_MPI(binfile, binfile_path, output_folder)
MPI <- detect_nonmovement(binfile, binfile_path, output_folder)

GENEAcore documentation built on April 11, 2025, 5:43 p.m.