Workarounds

HOME Here are links to some workarounds I have found useful:

R package runjags can't link to JAGS

R package shiny 's runUrl function fails to download the ZIP file with the app code.

The ImageMagick convert utility can't be run with the system function in R

Updated 19 Feb 2015 by Mike Meredith

Working with capture-recapture data often involves software that behaves differently across operating systems, and small adjustments can smooth out those differences. Many ecologists switch between Windows, Mac, and Linux machines during a project, and each environment interprets paths, libraries, and system calls in its own way. A few well-placed lines of code or configuration tweaks can keep an analysis running consistently regardless of the host platform. Documenting these adjustments helps others reuse the workflow without retracing the same troubleshooting steps, which is especially valuable for students and early-career researchers building their analytical toolkit.

Bayesian estimation with JAGS requires attention to how the sampler is initialised and how output is stored across chains. Conjugate updates and Gibbs steps can speed convergence for simpler models, while more complex hierarchical structures may need longer burn-in periods and careful thinning. Reviewing trace plots and effective sample sizes remains the most reliable way to judge whether a chain has mixed adequately. Organising posterior samples into tidy structures makes downstream summaries, such as credible intervals for density or detection probability, easier to compute and to communicate in reports or publications.

Spatial analyses benefit from pairing R packages with a dedicated GIS environment for preparing covariates and study-area layers. QGIS offers a free route to clip rasters, reproject coordinates, and extract habitat variables at animal locations or detector stations. Exporting these layers back into R for use in secr or occupancy models closes the loop between mapping and statistical inference. Keeping the spatial and statistical workflows modular means that updating a boundary, adding a covariate, or revisiting a buffer distance does not require rebuilding the entire analysis from scratch.

Camera-trap studies generate large volumes of images and detection records, and managing that data well is half the battle. Consistent naming conventions for folders, a simple spreadsheet for activity times, and reproducible scripts for summarising detections all reduce the time spent on manual bookkeeping. Activity patterns, sunrise and sunset offsets, and species overlap indices can then be calculated in a repeatable way. Treating the raw image archive and the analysis scripts as paired artefacts encourages transparency and makes future revisions far less painful when collaborators or reviewers request changes.

Workshops and short courses are an effective way to share practical skills in wildlife capture-recapture and spatial modelling. Participants benefit most when examples progress from simple single-session models to more elaborate spatially explicit designs with detection covariates. Providing sample data, commented code, and clear exercises allows attendees to revisit the material afterwards at their own pace. A welcoming environment, whether online or in person, encourages questions from people who are new to Bayesian methods or to particular R packages, and helps build a community of practice around robust ecological inference.