process_marker_data {ChestVolume}R Documentation

Process and Sort Marker Data for All Time Frames

Description

Processes the input dataset by sorting marker columns based on marker names and reformats it into a long format with columns 'Timeframe', 'Marker', 'X', 'Y', 'Z'. Adds a Timeframe column corresponding to each row (time frame) in the original data.

Usage

process_marker_data(data, convert_to_cm = TRUE)

Arguments

data

A data frame containing marker coordinate data for all time frames. Columns should be named in the format 'MXX X', 'MXX Y', 'MXX Z' where 'MXX' is the marker name.

convert_to_cm

Logical, if TRUE, divides X, Y, Z coordinates by 10 to convert to centimeters (from millimeters).

Details

The function reshapes the wide-format data into a long format suitable for analysis, adding a Timeframe column that corresponds to each time frame. Optionally converts units to centimeters.

Value

A data frame with columns 'Timeframe', 'Marker', 'X', 'Y', 'Z', sorted by Timeframe and Marker.

Examples

data(sample_data)
processed_data <- process_marker_data(head(sample_data), convert_to_cm = TRUE)
head(processed_data)


[Package ChestVolume version 1.0.0 Index]