if (FALSE) {
## from a capthist object, specifying almost everything
mask.check (possumCH, spacings = c(20, 30), buffers =c(200, 300),
realpar = list(g0 = 0.2, sigma = 50), CL = TRUE)
## from a fitted model, using defaults
mask.check (stoat.model.HN)
## LL did not change with varying buffer (rows) or spacing (cols):
## 78.125 58.59375 39.0625
## 1000 -144.0015 -144.0015 -144.0015
## 1500 -144.0017 -144.0017 -144.0017
## 2000 -144.0017 -144.0017 -144.0017
## fit new models for each combination of buffer & spacing,
## and save fitted models to a file
mask.check (stoat.model.HN, buffers = 1500, spacings =
c(40,60,80), LLonly = FALSE, file = "test", CL = TRUE)
## look in more detail at the preceding fits
## restores objects `mask.check.output' and `mask.check.fit'
load("test.RData")
lapply(mask.check.fit, predict)
lapply(mask.check.fit, derived)
## multi-session data
mask.check(ovenbird.model.1, session = c("2005","2009"))
## clipping mask
txtfilename <- system.file("extdata/possumarea.txt", package = "secr")
possumarea <- read.table(txtfilename, header = TRUE)
mask.check (possum.model.0, spacings = c(20, 30), buffers =
c(200, 300), poly = possumarea, LLonly = FALSE,
file = "temp", CL = TRUE)
## review fitted models
load ("temp.RData")
par(mfrow = c(2,2), mar = c(1,4,4,4))
for (i in 1:4) {
plot(traps(mask.check.fit[[i]]$capthist), border = 300,
gridlines = FALSE)
plot(mask.check.fit[[i]]$mask, add = TRUE)
lines(possumarea)
text ( 2698618, 6078427, names(mask.check.fit)[i])
box()
}
par(mfrow = c(1,1), mar = c(5,4,4,2) + 0.1) ## defaults
}
Run the code above in your browser using DataLab