fishR-Core-Team / FSA

FSA (Fisheries Stock Assessment) package provides R functions to conduct typical introductory fisheries analyses.
https://fishr-core-team.github.io/FSA/
GNU General Public License v2.0
66 stars 22 forks source link

Add catch in mrClosed() for data.frame as first argument and other vectors also provided #22

Closed droglenc closed 8 years ago

droglenc commented 8 years ago

For example,

lmb.dat <- data.frame(sample=1:4,
                      Total=   c(18,18,19,35),  # total number of fish (n)
                      Recaps=  c( 0, 9, 5,12),  # num recaptured fish (m)
                      Unmarked=c(18, 9,14,23),  # num fish not recaptured 
                      At_Large=c( 0,18,27,41),  # num marked fish prior to sample (M)
                      Rsubi=   c(18,18,19, 0))  # num marked fish returned to pop (R)
lmb.dat

library(FSA)

lmb.num1 <- mrClosed(lmb.dat, n=lmb.dat$Total, m=lmb.dat$Recaps, M=lmb.dat$At_Large, method="Schnabel")
summary(lmb.num1)

lmb.num2 <- mrClosed(lmb.dat, n=lmb.dat$Total, m=lmb.dat$Recaps, R=lmb.dat$Rsubi, method="Schnabel")
summary(lmb.num2)
droglenc commented 8 years ago

Partially (at least) address in v0.8.11.