Calculates the mean position of selected keypoints at each time point. The centroid is computed for each combination of grouping variables (individual, time, trial/session if present).
Usage
compute_centroid(
data,
include_keypoints = NULL,
exclude_keypoints = NULL,
centroid_name = "centroid"
)Arguments
- data
An aniframe with Cartesian coordinates (x, y, and/or z columns).
- include_keypoints
Character vector of keypoints to include in centroid calculation. If NULL (default), all keypoints are used unless
exclude_keypointsis specified. Mutually exclusive withexclude_keypoints.- exclude_keypoints
Character vector of keypoints to exclude from centroid calculation. If NULL (default), no keypoints are excluded. Mutually exclusive with
include_keypoints.- centroid_name
Name for the new centroid keypoint. Default is "centroid".