View source: R/particle_functions.R
trajectory_data | R Documentation |
Processes experimental particle tracking data and creates a standardized particle.data object. This function handles time series data with varying numbers of particles across time steps and maintains particle identity tracking between consecutive frames.
trajectory_data(particle_data)
particle_data |
A data frame containing particle tracking data with the following required columns:
|
Returns an S4 object of class particle.data
with:
Lists of particle x and y positions at each time step
Lists of particle x and y velocities at each time step
List of particle angles computed from velocities
List of data frames containing particle mappings between consecutive frames
"experiment"
Vector recording number of particles at each time step
Total number of time steps
Dimension of the output space (set to 1)
particle.data-class
for details on the particle.data class structure
# Create sample tracking data
sample_data <- data.frame(time = rep(1:3, each = 5),
particleID = rep(1:5, 3),
px = rnorm(15),py = rnorm(15),
vx = rnorm(15),vy = rnorm(15)
)
# Convert to particle.data object
traj <- trajectory_data(sample_data)
# Display summary
show(traj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.