Skip to contents

Calculate

These functions take your aniframe as input and give you results in return.

calculate_kinematics()
Calculate kinematic measures from trajectory data
calculate_tortuosity()
Calculate tortuosity metrics over sliding windows
calculate_nnd()
Calculate distance to n-th nearest neighbour

Summarise

These functions return a single value per group, or a full summary.

summarise_aniframe() summarize_aniframe()
Summarise an aniframe
summarise_kinematics() summarize_kinematics()
Calculate kinematic summary statistics
summarise_tortuosity() summarize_tortuosity()
Calculate tortuosity summary statistics
summarise_keypoints()
Summarize keypoint data

Compute

These functions are cogs used in calculate_ and summarise_ functions.

compute_gradient()
Compute numerical derivatives on possibly uneven grids
differentiate()
Differentiate a numeric series (optionally repeatedly)
compute_straightness()
Compute straightness index from precomputed vectors
compute_sinuosity()
Compute sinuosity index from precomputed vectors
compute_emax()
Compute E_max (maximum expected displacement) from pre‑computed vectors
compute_centroid()
Compute centroid from keypoints
compute_nnd()
Compute nearest neighbour distances for a single time point

Helpers

is_aniframe_kin()
Check if object is an aniframe_kin
mean_angle()
Compute the circular mean of angles
median_angle()
Compute the circular median of angles