skip to main content
US FlagAn official website of the United States government
dot gov icon
Official websites use .gov
A .gov website belongs to an official government organization in the United States.
https lock icon
Secure .gov websites use HTTPS
A lock ( lock ) or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.


Title: swaRmverse: An R package for the comparative analysis of collective motion
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 theswaRmversepackage. Building on two existing R packages,trackdfandswaRm,swaRmverseenables 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),swaRmverseidentifies 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.  more » « less
Award ID(s):
2222418
PAR ID:
10556715
Author(s) / Creator(s):
 ;  ;  
Publisher / Repository:
Wiley-Blackwell
Date Published:
Journal Name:
Methods in Ecology and Evolution
Volume:
16
Issue:
1
ISSN:
2041-210X
Format(s):
Medium: X Size: p. 29-39
Size(s):
p. 29-39
Sponsoring Org:
National Science Foundation
More Like this
  1. Abstract Occupancy modelling is a common approach to assess species distribution patterns, while explicitly accounting for false absences in detection–nondetection data. Numerous extensions of the basic single‐species occupancy model exist to model multiple species, spatial autocorrelation and to integrate multiple data types. However, development of specialized and computationally efficient software to incorporate such extensions, especially for large datasets, is scarce or absent.We introduce thespOccupancy Rpackage designed to fit single‐species and multi‐species spatially explicit occupancy models. We fit all models within a Bayesian framework using Pólya‐Gamma data augmentation, which results in fast and efficient inference.spOccupancyprovides functionality for data integration of multiple single‐species detection–nondetection datasets via a joint likelihood framework. The package leverages Nearest Neighbour Gaussian Processes to account for spatial autocorrelation, which enables spatially explicit occupancy modelling for potentially massive datasets (e.g. 1,000s–100,000s of sites).spOccupancyprovides user‐friendly functions for data simulation, model fitting, model validation (by posterior predictive checks), model comparison (using information criteria and k‐fold cross‐validation) and out‐of‐sample prediction. We illustrate the package's functionality via a vignette, simulated data analysis and two bird case studies.ThespOccupancypackage provides a user‐friendly platform to fit a variety of single and multi‐species occupancy models, making it straightforward to address detection biases and spatial autocorrelation in species distribution models even for large datasets. 
    more » « less
  2. Abstract Quantitative evaluations to optimize complexity have become standard for avoiding overfitting of ecological niche models (ENMs) that estimate species’ potential geographic distributions.ENMevalwas the first R package to make such evaluations (often termed model tuning) widely accessible for the Maxent algorithm. It also provided multiple methods for partitioning occurrence data and reported various performance metrics.Requests by users, recent developments in the field, and needs for software compatibility led to a major redesign and expansion. We additionally conducted a literature review to investigate trends inENMevaluse (2015–2019).ENMeval2.0 has a new object‐oriented structure for adding other algorithms, enables customizing algorithmic settings and performance metrics, generates extensive metadata, implements a null‐model approach to quantify significance and effect sizes, and includes features to increase the breadth of analyses and visualizations. In our literature review, we found insufficient reporting of model performance and parameterization, heavy reliance on model selection with AICc and low utilization of spatial cross‐validation; we explain howENMeval2.0 can help address these issues.This redesigned and expanded version can promote progress in the field and improve the information available for decision‐making. ​ 
    more » « less
  3. Abstract Ecologists have long been interested in linking individual behaviour with higher level processes. For motile species, this ‘upscaling’ is governed by how well any given movement strategy maximizes encounters with positive factors and minimizes encounters with negative factors. Despite the importance of encounter events for a broad range of ecological processes, encounter theory has not kept pace with developments in animal tracking or movement modelling. Furthermore, existing work has focused primarily on the relationship between animal movement and encounterrateswhile the relationship between individual movement and the spatiallocationsof encounter events in the environment has remained conspicuously understudied.Here, we bridge this gap by introducing a method for describing the long‐term encounter location probabilities for movement within home ranges, termed the conditional distribution of encounters (CDE). We then derive this distribution, as well as confidence intervals, implement its statistical estimator into open‐source software and demonstrate the broad ecological relevance of this distribution.We first use simulated data to show how our estimator provides asymptotically consistent estimates. We then demonstrate the general utility of this method for three simulation‐based scenarios that occur routinely in biological systems: (a) a population of individuals with home ranges that overlap with neighbours; (b) a pair of individuals with a hard territorial border between their home ranges; and (c) a predator with a large home range that encompassed the home ranges of multiple prey individuals. Using GPS data from white‐faced capuchinsCebus capucinus, tracked on Barro Colorado Island, Panama, and sleepy lizardsTiliqua rugosa,tracked in Bundey, South Australia, we then show how the CDE can be used to estimate the locations of territorial borders, identify key resources, quantify the potential for competitive or predatory interactions and/or identify any changes in behaviour that directly result from location‐specific encounter probability.The CDE enables researchers to better understand the dynamics of populations of interacting individuals. Notably, the general estimation framework developed in this work builds straightforwardly off of home range estimation and requires no specialized data collection protocols. This method is now openly available via thectmm Rpackage. 
    more » « less
  4. Abstract Numerous modelling techniques exist to estimate abundance of plant and animal populations. The most accurate methods account for multiple complexities found in ecological data, such as observational biases, spatial autocorrelation, and species correlations. There is, however, a lack of user‐friendly and computationally efficient software to implement the various models, particularly for large data sets.We developed thespAbundance Rpackage for fitting spatially explicit Bayesian single‐species and multi‐species hierarchical distance sampling models, N‐mixture models, and generalized linear mixed models. The models within the package can account for spatial autocorrelation using Nearest Neighbour Gaussian Processes and accommodate species correlations in multi‐species models using a latent factor approach, which enables model fitting for data sets with large numbers of sites and/or species.We provide three vignettes and three case studies that highlightspAbundancefunctionality. We used spatially explicit multi‐species distance sampling models to estimate density of 16 bird species in Florida, USA, an N‐mixture model to estimate black‐throated blue warbler (Setophaga caerulescens) abundance in New Hampshire, USA, and a spatial linear mixed model to estimate forest above‐ground biomass across the continental USA.spAbundanceprovides a user‐friendly, formula‐based interface to fit a variety of univariate and multivariate spatially explicit abundance models. The package serves as a useful tool for ecologists and conservation practitioners to generate improved inference and predictions on the spatial drivers of abundance in populations and communities. 
    more » « less
  5. Abstract Gene flow is increasingly recognized as an important macroevolutionary process. The many mechanisms that contribute to gene flow (e.g. introgression, hybridization, lateral gene transfer) uniquely affect the diversification of dynamics of species, making it important to be able to account for these idiosyncrasies when constructing phylogenetic models. Existing phylogenetic‐network simulators for macroevolution are limited in the ways they model gene flow.We presentSiPhyNetwork, an R package for simulating phylogenetic networks under a birth–death‐hybridization process.Our package unifies the existing birth–death‐hybridization models while also extending the toolkit for modelling gene flow. This tool can create patterns of reticulation such as hybridization, lateral gene transfer, and introgression.Specifically, we model different reticulate events by allowing events to either add, remove or keep constant the number of lineages. Additionally, we allow reticulation events to be trait dependent, creating the ability to model the expanse of isolating mechanisms that prevent gene flow. This tool makes it possible for researchers to model many of the complex biological factors associated with gene flow in a phylogenetic context. 
    more » « less