[R] Introduction to mark-recapture analysis in R?

Jeff Laake Jeff.Laake at noaa.gov
Tue Oct 13 18:27:58 CEST 2009


Another package that is not on CRAN or other R depository is RMark.  It 
works with the software MARK which does the computation.  You can find 
RMark at  http://www.phidot.org/software/mark/rmark/
and MARK from http://www.phidot.org/software/mark/index.html
 From the same site you'll find a very comprehensive electronic book 
(that describes how to use MARK 
(http://www.phidot.org/software/mark/docs/book/) and it has an appendix 
(http://www.phidot.org/software/mark/docs/book/pdf/app_3.pdf)that 
describes use of RMark.  You may also want to look at the RMark workshop 
notes 
(http://www.phidot.org/software/mark/rmark/RMarkWorkshopNotes.pdf). 
<http://www.phidot.org/software/mark/rmark/RMarkWorkshopNotes.pdf>

RMark does contain some routines that do CJS and JS models solely in R 
(see ?cjs and ?js) but they are experimental at this point.  RMark was 
not put on CRAN because with the above exceptions it does require MARK 
which is a separate piece of FORTRAN software that runs only in WINDOWS, 
although it possible to obtain a LINUX version with some work.  MARK is 
freely available software as an executable but is not open-source per 
se.  Source for RMark is available from the above sites.

With regard to creating capture histories in R, that is easily 
accomplished with the table function.  For example, if x is a dataframe 
of capture/recapture events with fields ID (unique identifier) and 
Occasion  is a  factor variable for the capture occasion then

chmat=with (x, table(ID,Occasion))

will create a count of captures by ID and Occasion.  If an animal can be 
caught more than once per occasion then add:

chmat[chmat>0]=1

Then you can change to capture history strings with:

apply(chmat,1,paste,sep="")

Here is a simple example (with nonsense data)

x=data.frame(ID=floor(10*runif(100))+1,Occasion=floor(5*runif(100))+1)
chmat=with (x, table(ID,Occasion))
chmat[chmat>0]=1
ch=apply(chmat,1,paste,collapse="")
table(ch)

If you wanted to include individual covariates you would not use the 
last table(ch) statement but would tie back to any individual data.

regards --jeff






Anne-Katrin Link wrote:
> Normal        0        21                        false        false        
> false                                                                
> MicrosoftInternetExplorer4                                                  
>               
>
> Dear R-helpers,        
>
>          I was wondering whether there are any good books and/or website 
> links that introduce mark-recapture analysis in R. In particular, I am 
> interested in exploratory data analysis of resighting data and how to 
> create capture histories from dataframes in R.        
>
> Thank you very much for your reply in advance!        
>
>          Cheers,         
>
> Anne    
>   
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list