## Introduction

A diverse array of software programs are currently available to analyse mark–recapture data. The most comprehensive software package is arguably program MARK (White & Burnham 1999), which uses FORTRAN code to estimate demographic parameters where sources of variation in those parameters (e.g. survival, detection probability) are manually specified within a graphical user interface (GUI). RMark (Laake 2013) is a package for R (R Core Development Team 2012) that constructs models for MARK with user-specified formulas to replace GUI-based model creation.

A number of stand-alone R packages have been developed to analyse capture–recapture data, usually with a narrower focus than MARK (e.g. Rcapture, Baillargeon & Rivest 2007; mra, McDonald *et al*. 2005; secr, Borchers & Efford 2008; btspas, Schwarz *et al*. 2009; SPACECAP, Gopalaswamy *et al*. 2012; BaSTA, Colchero, Jones & Rebke 2012). Each package is designed for a unique niche or model structure. We believe these alternative packages are useful because they expand the analyst's toolbox, and the code is open source which enables the user to understand fully what the software is doing.

Here, we describe marked, a free open-source mark–recapture package that runs in the R environment (R Core Development Team 2012). The original impetus for the package was to improve on the execution times of RMark/MARK for fitting of Cormack–Jolly–Seber (CJS) models to data sets with thousands of animals and many time-varying individual (animal-specific) covariates by making the model and data structures more efficient. Subsequently, we also implemented the CJS model using Automatic Differentiation Model Builder (ADMB; Fournier *et al*. 2012) and incorporated individual heterogeneity via random effects with admbre (Skaug & Fournier 2006). ADMB provides a flexible framework for fitting models of capture–recapture data and has been recently used by Ford, Bravington & Robbins (2012) to incorporate random effects in multistate models. Instructions for interfacing marked with ADMB are provided in the marked package help for function *crm*. We also added a Bayesian Markov Chain Monte Carlo (MCMC) implementation of the CJS model based on the approach used by Albert & Chib (1993) for analysing binary data with a probit regression model. In addition, we implemented the Jolly–Seber (JS) model with the Schwarz & Arnason (1996) Population Analysis (POPAN) structure by extending the hierarchical approach to likelihood construction of Pledger, Pollock & Norris (2003) to the entry of animals into the population.

Below, we provide a brief background on the models currently implemented in marked and depict the work flow with regard to data formatting, processing and model fitting. We illustrate use of marked with the European dipper (*Cinclus cinclus*) mark–recapture data analysed in Lebreton *et al*. (1992). Further information, including help files, example data and analysis, and a vignette with more technical explanation of the statistical methods, code structure and package usage can be obtained by downloading the marked package from CRAN (http://cran.r-project.org).