R Code for mark-recapture analysis