View source: R/particle_functions.R
get_consecutive_data | R Documentation |
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.
get_consecutive_data(data_obj, variable = c("vx", "vy", "px", "py", "theta"))
data_obj |
An object of class |
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). |
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.
## Not run:
vx_pairs = get_consecutive_data(data_obj, "vx")
vx_list = vx_pairs$start
vx_end_list = vx_pairs$end
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.