A free, open-source R pipeline that helps wildlife researchers organize capture–recapture data, examine residency and site fidelity, and explore population abundance.
What can repeated encounters with the same dolphin—or any individually recognizable animal—tell us about a population? Quite a lot. A sequence of sightings can reveal which animals regularly use an area, which appear only briefly, how faithfully individuals return, and how many animals may be present but unseen.
The difficulty is that these answers do not emerge directly from a spreadsheet. Researchers must first organize encounter histories, check the data, choose methods suited to the sampling design, examine assumptions, interpret model output, and preserve enough information for others to reproduce the analysis. RESIDENT was created to bring those tasks into one guided workflow.
What is RESIDENT?
RESIDENT is a standalone, interactive pipeline written in R for animal capture–recapture analysis. It is aimed primarily at students and researchers in marine mammal ecology and wildlife biology, although the underlying approach can be useful whenever individuals are repeatedly identified over time.
The name reflects one of the questions at the center of many field studies: is an animal a regular resident of a study area, an occasional visitor, or a transient individual passing through? The pipeline also supports broader questions about site fidelity, discovery, detection, and population abundance.
Instead of requiring users to assemble every step from separate scripts, RESIDENT presents an interactive menu. It guides the analyst from importing and validating data to summaries, model selection, diagnostics, plots, and exportable results.
Capture–recapture, in plain language
Imagine photographing dolphins during a series of surveys. Some animals are recognized repeatedly from markings on their dorsal fins; others are seen once, disappear for several surveys, and later return. Each individual accumulates an encounter history—a record of the occasions on which it was or was not detected.
Those histories contain valuable information, but they must be interpreted carefully. Not seeing an animal does not necessarily mean it left the area: it may simply have gone undetected. Capture–recapture models help separate the biological process from the observation process. That distinction is essential when estimating abundance or drawing conclusions about residency.
What the pipeline can do
RESIDENT brings several common tasks into a single reproducible environment:
- Import multiple formats used in wildlife research, including Program MARK files, SOCPROG long-format records, wide capture-history tables, original MARK .inp files, and Excel workbooks.
- Validate encounter histories and summarize detections, sampling occasions, discovery patterns, and readiness for further analysis.
- Apply published, literature-based rules to classify residency and site-fidelity patterns, while explaining which classifier is most suitable for the available data.
- Guide users through the selection of abundance and population models according to the structure and limitations of their dataset.
- Produce closed-capture, Huggins, robust-design, state-space, and descriptive Chao outputs, with diagnostic labeling where an implementation is not intended for final likelihood-based inference.
- Audit important model assumptions, identify likely sources of bias, and recommend practical next steps.
- Generate plots and export tables, figures, summaries, and configuration information for reporting and reproducibility.
Why this matters
Wildlife datasets are often difficult and expensive to collect. A field season may represent months of boat surveys, thousands of photographs, and years of work identifying individuals. Analysis software should help researchers make the most of that effort without hiding the assumptions behind a convenient button.
RESIDENT is designed to be instructive as well as practical. Its menus and reports do more than return a number: they explain what was examined, which assumptions deserve attention, and when an output should be treated as descriptive or diagnostic. This makes the pipeline potentially useful especially for students learning how analytical choices affect ecological conclusions.
Reproducibility is another priority. The project includes example data, input templates, usage notes, a configuration record, and a regression test suite. Because the source code is openly available, users can inspect the methods, adapt the workflow, propose improvements, and document the version used in a study.
Designed for real data workflows
A typical session begins by loading an encounter-history file. RESIDENT can automatically detect several supported formats, display summaries of the imported records, and review detection patterns and model assumptions. The user can then generate literature-based classifications, explore discovery and completeness, select an appropriate population model, compare results, and export the outputs to a project folder.
This integrated approach reduces repetitive data handling and keeps the analytical sequence visible. Just as importantly, it encourages users to stop and examine whether the data actually support the question being asked.
Open source—and open to improvement
RESIDENT is released under the MIT License. It can be downloaded, used, modified, and redistributed under the terms of that license. The repository also includes instructions for reporting bugs, suggesting features, and contributing to development.
The current release is version 0.9.41, so the project should be understood as active, pre-1.0 software. It requires a recent version of R and the TMB package, together with a working C++ compiler. Excel import is supported through the optional readxl package.
Transparency about limitations is part of the design. Some advanced model families are not yet implemented as complete Program MARK-equivalent likelihoods. The pipeline identifies relevant outputs as diagnostic so that they are not mistaken for final, directly comparable likelihood inference. Users should always review model assumptions, sampling design, and diagnostic results before drawing biological conclusions.
Where to find RESIDENT
The code, documentation, templates, example data, installation instructions, and issue tracker are available on GitHub: github.com/RodrigoMorteo/resident
If you work with capture–recapture, photo-identification, residency, site-fidelity, or abundance data, I invite you to explore the repository and test the pipeline with an appropriate dataset. Feedback from researchers, students, and developers is especially valuable at this stage: real-world use is what reveals where a scientific tool is clear, where it is fragile, and where it should go next.
Please share the project with colleagues who may find it useful—and, if you use RESIDENT in research, consult the repository’s citation section for the associated scientific publication and current software-citation guidance.
Suggested publication details
URL slug: meet-resident-capture-recapture-population-analysis
Excerpt: Meet RESIDENT, a free open-source R pipeline that helps wildlife researchers transform encounter histories into insights about abundance, residency, site fidelity, and detection.
Categories: Development of Software; Education
Suggested tags: R, open-source software, capture–recapture, marine mammals, wildlife ecology, population abundance, residency, site fidelity, reproducible research.
Suggested reading materials
- Bolaños-Jiménez J., Morteo E., Fruet P., Secchi E., Delfín-Alfonso C., Bello-Pineda J. 2022. Seasonal population parameters reveal sex-related dynamics of bottlenose dolphins off open waters of the Southwestern Gulf of Mexico. Marine Mammal Science 38(2):705-724. ISSN: 1748-7692, doi: 10.1111/MMS.12897
- Huesca-Domínguez I., Morteo E., Abarca-Arenas L.G., Balmer B.C., Cox T. M., Delfín-Alfonso C.A., Hernández-Candelario I.C. 2024. Method selection affects the estimates of residency and site fidelity in bottlenose dolphins: Testing sensitivity and performance of different methods using mark-resight data. PeerJ 12:e18329. ISSN 2167-8359. http://doi.org/10.7717/peerj.18329
- Huesca-Domínguez I., Morteo E., Abarca-Arenas L.G., Balmer B.C., Cox T. M., Delfín-Alfonso C.A., Hernández-Candelario I.C. 2024. Assessing residency and site fidelity in bottlenose dolphins: a literature review and bibliometric analysis. Aquatic Mammals 50(3):199-214. ISSN: 1996-7292. https://doi.org/10.1578/AM.50.3.2024.199
- Morteo E., Rocha-Olivares A., Morteo R. 2012. Sensitivity analysis of residency and site fidelity estimations to variations in sampling effort and individual catchability. Revista Mexicana de Biodiversidad 83(2):487-495.
- Morteo E., Rocha-Olivares A., Abarca-Arenas L.G. 2017. Abundance, residency and potential hazards for coastal bottlenose dolphins (Tursiops truncatus) off a productive lagoon in the Gulf of Mexico. Aquatic Mammals 43(3):308-319. ISSN: 1996-7292, doi: 10.1578/AM.43.3.2017.308