plot.CMRCTData: Plot for a CMRCTData object

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

Description

Plot the capture occasions and the captures occasions.

Usage

1
2
## S3 method for class 'CMRCTData'
plot(x, main="capture histories", ...)

Arguments

x

an object of class 'CMRCTData', result of 'CMRData'. See '?CMRData' for details.

main

a title for the plot.

...

other parameter to be passed throuh to plotting fucntions.

Details

The function return a plot of the capture occasions and of the capture histories.

Author(s)

Hugues Santin-Janin (hugues_sj@yahoo.fr) and David Fouchet (david.fouchet@univ-lyon1.fr)

References

Fouchet D., Santin-Janin H., Sauvage F., Yoccoz N.-G. & Pontier D. (submitted) An R package for analyzing survival using continuous-time open capture-recapture models: an example with feral cats on sub-Antarctic islands.

See Also

CMRData

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
## Not run: 
##An example with simulated data
##Let define some arguments
start <- as.POSIXct(strptime("01/01/2000", "%d/%m/%Y"))
factind <- list(sex=c("M", "F"))
##numind <- list(weight=c(0.5, 4))
numtps <- list(rain=c(0, 100))

##Simulate the set of covariables
set.seed(123)
simvars <- CMRSimVars(n=15 , npop=4, start=start, step="6 months",
nstep=12, factind=factind, numtps=numtps, length="5 weeks",
clage=c(2), minage=0.1, maxage=20)

##Plot the simulated capture occasions
plot(simvars)

##True model
surv <- as.formula(~pop + age)
capt <- as.formula(~t)

##True model parameters values
#Survival parameters: Intercept, pop2, pop3, pop4, age1
surv.pars <- c(-2, 1.5, -0.1, -0.5, 0.3)
#Capture parameters: Intercept, t
capt.pars <- c(-1, 0.24)
theta <- c(surv.pars, capt.pars)


##Simulating a dataset
set.seed(456)
simdata <- CMRSimData(simvars=simvars, surv=surv, capt=capt, theta=theta)

##Plot the simulated capture occasions and capture histories
plot(simdata)


## End(Not run)

CMRCT documentation built on May 2, 2019, 6:44 p.m.