swaRmverse: An R package for the comparative analysis of collective motion - Marina Papadopoulou; Simon Garnier; Andrew J. King (Methods in Ecology and Evolution)
Abstract Collective motion, that is the coordinated spatial and temporal organisation of individuals, is a core element in the study of collective animal behaviour. The self‐organised properties of how a group moves influence its various behavioural and ecological processes, such as predator–prey dynamics, social foraging and migration. However, little is known about the inter‐ and intra‐specific variation in collective motion. Despite the significant advancement in high‐resolution tracking of multiple individuals within groups, providing collective motion data for animals in the laboratory and the field, a framework to perform quantitative comparisons across species and contexts is lacking. Here, we present the swaRmverse package. Building on two existing R packages, trackdf and swaRm, swaRmverse enables the identification and analysis of collective motion ‘events’, as presented in Papadopoulou et al. (2023), creating a unit of comparison across datasets. We describe the package's structure and showcase its functionality using existing datasets from several species and simulated trajectories from an agent‐based model. From positional time‐series data for multiple individuals (x‐y‐t‐id), swaRmverse identifies events of collective motion based on the distribution of polarisation and group speed. For each event, a suite of validated biologically meaningful metrics are calculated, and events are placed into a ‘swarm space’ through dimensional reduction techniques. Our package provides the first automated pipeline enabling the analysis of data on collective behaviour. The package allows the calculation and use of complex metrics for users without a strong quantitative background and will promote communication and data‐sharing across disciplines, standardising the quantification of collective motion across species and promoting comparative investigations.