Reads and formats movement tracking data exported from TRex (Walter & Couzin, 2021). TRex is a software for tracking animal movement in videos, which exports coordinate data in CSV format. This function processes these files into a standardized movement data format.
Value
A data frame containing movement data with the following columns:
time
: Time values from the trackingindividual
: Factor (set to NA, as TRex tracks one individual)keypoint
: Factor identifying tracked points (e.g., "head", "centroid")x
: x-coordinates in centimetersy
: y-coordinates in centimetersconfidence
: Numeric confidence values (set to NA as TRex doesn't provide these)
Details
The function performs several processing steps:
Validates the input file format (must be CSV)
Reads the data using vroom for efficient processing
Cleans column names to a consistent format
Restructures the data from wide to long format
Initializes metadata fields required for movement data
References
Walter, T., & Couzin, I. D. (2021). TRex, a fast multi-animal tracking system with markerless identification, and 2D estimation of posture and visual fields. eLife, 10, e64000.
See also
init_metadata()
for details on metadata initializationTRex software: https://trex.run