detect_transitions: Detect Transitions

View source: R/MPI_detect.R

detect_transitionsR Documentation

Detect Transitions

Description

Detect Transitions

Usage

detect_transitions(
  binfile,
  binfile_path,
  output_folder,
  minimum_event_duration = 3,
  x_cpt_penalty = 20,
  y_cpt_penalty = 30,
  z_cpt_penalty = 20,
  CutTime24Hr = "15:00"
)

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.

minimum_event_duration

The minimum interval between changepoint transitions.

x_cpt_penalty

The manual penalty value applied in the PELT changepoint algorithm for the x axis, see cpt.var.

y_cpt_penalty

The manual penalty value applied in the PELT changepoint algorithm for the y axis, see cpt.var.

z_cpt_penalty

The manual penalty value applied in the PELT changepoint algorithm for the z axis, see cpt.var.

CutTime24Hr

Time in 24h to split the days up by.

Details

Function to detect mean and variance changepoints in 1Hz acceleration data from a bin file.

Value

List of time, index and day number of each transition within the measurement period information.

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_transitions(binfile, binfile_path, output_folder)

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