# simple
temptrap <- make.grid()
tempmask <- make.mask(temptrap)
plot (tempmask)
if (FALSE) {
## restrict to points over an arbitrary detection threshold,
## add covariate, plot image and overlay traps
tempmask <- subset(tempmask, pdot(tempmask, temptrap,
noccasions = 5)>0.001)
covariates (tempmask) <- data.frame(circle =
exp(-(tempmask$x^2 + tempmask$y^2)/10000) )
plot (tempmask, covariate = "circle", dots = FALSE, axes = TRUE,
add = TRUE, breaks = 8, col = terrain.colors(8), mesh = NA)
plot (temptrap, add = TRUE)
## add a legend
par(cex = 0.9)
covrange <- range(covariates(tempmask)$circle)
step <- diff(covrange)/8
colourlev <- terrain.colors(9)
zlev <- format(round(seq(covrange[1],covrange[2],step),2))
legend (x = "topright", fill = colourlev, legend = zlev,
y.intersp = 0.8, title = "Covariate")
title("Colour mask points with p.(X) > 0.001")
mtext(side=3,line=-1, "g0 = 0.2, sigma = 20, nocc = 5")
## Waitarere possum density surface extrapolated across region
regionmask <- make.mask(traps(possumCH), buffer = 1000, spacing = 10,
poly = possumremovalarea)
dts <- distancetotrap(regionmask, possumarea)
covariates(regionmask) <- data.frame(d.to.shore = dts)
shorePossums <- predictDsurface(possum.model.Ds, regionmask)
## plot as coloured pixels with white lines
colourlev <- terrain.colors(7)
plot(shorePossums, breaks = seq(0,3.5,0.5), plottype = "shaded",
poly = FALSE, col = colourlev, mesh = NA)
plot(traps(possumCH), add = TRUE, detpar = list(col = "black"))
polygon(possumremovalarea)
## check some point densities
spotHeight(shorePossums, dec = 1, col = "black")
## add a legend
zlev <- format(seq(0,3,0.5), digits = 1)
legend (x = "topright", fill = colourlev, legend =
paste(zlev,"--"), y.intersp = 1, title = "Density / ha")
}
Run the code above in your browser using DataLab