get_consecutive_data: Extract consecutive time steps data from particle...

View source: R/particle_functions.R

get_consecutive_dataR Documentation

Extract consecutive time steps data from particle trajectories

Description

Extracts paired data from consecutive time steps for a specified variable in particle trajectory data. This function is particularly useful for experimental data, where it uses particle tracking information to maintain particle identity between frames.

Usage

get_consecutive_data(data_obj, variable = c("vx", "vy", "px", "py", "theta"))

Arguments

data_obj

An object of class particle.data containing particle trajectory data.

variable

A character string specifying which variable to extract. Must be one of "vx" (x-velocity), "vy" (y-velocity), "px" (x-position), "py" (y-position), or "theta" (angle).

Value

Returns a list with two components:

start

A list of length T_time containing the data at each time step t.

end

A list of length T_time containing the corresponding data at time step t+1.

For each time t, start[[t]] and end[[t]] contain paired measurements for the same particles at consecutive time steps.

Examples

## Not run: 
vx_pairs = get_consecutive_data(data_obj, "vx")
vx_list = vx_pairs$start
vx_end_list = vx_pairs$end

## End(Not run)

FastGaSP documentation built on April 4, 2025, 5:16 a.m.