capHistConvert
for a discussion of data file format types). Summarized capture history results may be used in the Lincoln-Petersent, Schnabel, Schumacher-Eschmeyer, or Jolly-Seber methods for estimating population abundance (see mrClosed
and mrOpen
).
capHistSum(df, cols2use = NULL, cols2ignore = NULL)
"plot"(x, what = c("u", "f"), pch = 19, cex.pch = 0.7, lwd = 1, ...)
df
that contain the capture histories. Negative numeric values will not use those columns. Cannot use both cols2use
and col2ignore
. See details.df
that do not contain the capture histories and should be ignored. Cannot use both cols2use
and col2ignore
.capHistSum
.plot
. See details.cex.pch=0.7
).plot
.caphist
A vector summarizing the frequency of fish with each capture history.
sum
A data.frame that contains the number of marked fish from the first sample (M
), the number of captured fish in the second sample (n
), and the number of recaptured (i.e. previously marked) fish in the second sample (m
).
caphist
A vector summarizing the frequency of fish with each capture history.
sum
A data frame that contains the the number of captured fish in the ith sample (n
), the number of recaptured (i.e. previously marked) fish in the ith sample (m
), the number of marked fish returned to the population following the ith sample (R
; this will equal n
as the function currently does not handle mortalities); the number of marked fish in the population prior to the ith sample (M
); the number of fish first seen in the ith sample (u
); the number of fish lasst seen in the ith sample (v
); and the number of fish seen i times (f
).
methodB.top
A matrix that contains the top of the Method B table used for the Jolly-Seber method (i.e., a contingency table of capture sample (columns) and last seen sample (rows)).
methodB.bot
A data.frame that contains the bottom of the Method B table used for the Jolly-Seber method (i.e., the number of marked fish in the sample (m
), the number of unmarked fish in the sample (u
), the total number of fish in the sample (n
), and the number of marked fish returned to the population following the sample (R
).
m.array
A matrix that contains the the so-called m-array. The first column contains the number of fish captured on the ith event. The columns labelled with cX prefix show the number of fish originally captured in the ith row that were captured in the Xth event. The last column shows the number of fish originally captured in the ith row that were never recaptured.
capHistConvert
for a description of this (and other) formats and for methods to convert from other formats to the individual fish format. In addition, this function requires only the capture history portion of the data file. Thus, if df
contains columns with non-capture history information (e.g., fish ID, length, location, etc.) then use cols2use=
to identify which columns contain only the capture history information. Columns to use can be identified by listing the column numbers (e.g., columns 2 through 7 could be included with cols2use=2:7
). In many instances it may be easier to identify columns to exclude which can be done by preceding the column number by a negative sign (e.g., columns 1 through 3 are excluded with cols2use=-(1:3)
).The object returned from this function can be used directly in mrClosed
and mrOpen
. See examples of this functionality on the help pages for those functions.
The plot
function can be used to construct the two diagnostic plots described by Baillargeon and Rivest (2007). The what="f"
plot will plot the log of the number of fish seen i times divided by choose(t,i)
against i. The what="u"
plot will plot the log of the number of fish seen for the first time on event i against i. Baillargeon and Rivest (2007) provide a table that can be used to diagnosed types of heterogeneities in capture probabilities from these plots.
Baillargeon, S. and Rivest, L.-P. (2007). Rcapture: Loglinear models for capture-recapture in R. Journal of Statistical Software, 19(5):1-31.
descriptive
in Rcapture for m.array
and some of the same values in sum
. See capHistConvert
for a descriptions of capture history data file formats and how to convert between them. See mrClosed
and mrOpen
for how to estimate abundance from the summarized capture history information.
# data.frame with IDs in the first column
data(PikeNYPartial1)
head(PikeNYPartial1)
# Three ways to ignore first column of ID numbers
( ch1 <- capHistSum(PikeNYPartial1,cols2use=-1) )
( ch1 <- capHistSum(PikeNYPartial1,cols2ignore=1) )
( ch1 <- capHistSum(PikeNYPartial1,cols2ignore="id") )
# diagnostic plots
plot(ch1)
plot(ch1,what="f")
plot(ch1,what="u")
# An examle with only two sample events (for demonstration only)
( ch2 <- capHistSum(PikeNYPartial1,cols2use=-c(1,4:5)) )
Run the code above in your browser using DataLab