transform.to.rmark: Transforms sample.cr data to RMark format

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Conversion function transforming Wisp objects of type sample.cr into R objects that can be analyzed by the routines in the R package RMark.

Usage

1

Arguments

sample

object created by generate.sample.cr or built-in dataset in Wisp

Details

The storage of the capture histories within a Wisp object of type sample.cr needs to be transformed so these data can be analyzed by routines in the RMark library. This transformation is quite simple, and is conducted by this function.

Transformed objects may then be analyzed using RMark. Routines in the RMark library can create more sophisticated closed abundance models than are available in Wisp.

Value

Data frame consisting of a single field, ch, a character variable containing the capture histories of each animal in the sample.

Author(s)

Eric Rexstad, RUWPA ericr@mcs.st-and.ac.uk

References

Borchers, Buckland, and Zucchini (2002), Estimating animal abundance: closed populations. Chapter 5 http://www.ruwpa.st-and.ac.uk/estimating.abundance RMark home page by Jeff Laake, http://www.phidot.org/software/mark/rmark/ RMark chapter of Gentle introduction to Mark http://www.phidot.org/software/mark/docs/book/pdf/app_3.pdf

See Also

generate.sample.cr, birds1997.samp.cr, chips.samp.cr, taxi.samp.cr, and voles1.samp.cr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#  Generate population, and take mark-recapture sample
cr.reg<-generate.region(x.length=100, y.width=50)
cr.dens<-generate.density(cr.reg)
cr.poppars<-setpars.population(density.pop = cr.dens, number.groups = 100, size.method = "poisson",
                              size.min = 1, size.max = 5, size.mean = 1, exposure.method = "beta",
                              exposure.min = 2, exposure.max = 10, exposure.mean = 3,
                              exposure.shape = 0.5, type.values = c("Male","Female"),
                              type.prob = c(0.48,0.52))
cr.pop<-generate.population(cr.poppars)

cr.des<-generate.design.cr(cr.reg, n.occ = 6)
cr.survpars<-setpars.survey.cr(cr.pop, cr.des, pmin.unmarked=0.00001, pmax.unmarked=0.5, improvement=0.01)

mark.recap.samp<-generate.sample.cr(cr.survpars)
summary(mark.recap.samp)

test <- transform.to.rmark(mark.recap.samp)

pdotshared <- list(formula=~1,share=TRUE)
ptimeshared <- list(formula=~time,share=TRUE)
ptime <- list(formula=~time)
ptime.mixtureshared <- list(formula=~time*mixture,share=TRUE)
ptimemixtureshared <- list(formula=~time+mixture,share=TRUE)
pmixture <- list(formula=~mixture)

#   Capture Closed models
#
require(RMark)
#  constant p=c
test.closed.m0 <- mark(test,model="Closed",model.parameters=list(p=pdotshared))
#  constant p and constant c but different
test.closed.mb <- mark(test,model="Closed")
#  time varying p=c
test.closed.mt <- mark(test,model="Closed",model.parameters=list(p=ptimeshared))
#  time varying p + additive c
test.closed.mtb <- mark(test,model="Closed",model.parameters=list(p=ptime))
#
#  Closed heterogeneity models
#
#  2 mixtures Mh2
test.closed.Mh2 <- mark(test,model="HetClosed",model.parameters=list(p=pmixture))
#  Closed Mth2 - p different for time and mixtures
test.closed.Mth2 <- mark(test,model="FullHet",
				model.parameters=list(p=ptime.mixtureshared),adjust=TRUE)
#  Closed Mth2 - p different for time; mixture additive
test.closed.Mth2.additive <- mark(test,model="FullHet",
				model.parameters=list(p=ptimemixtureshared),adjust=TRUE)

test.table <- model.table(adjust=TRUE)
test.table

dill/wisp documentation built on May 15, 2019, 8:31 a.m.