## generate some polygon data
pol <- make.poly()
CH <- sim.capthist(pol, popn=list(D=30), detectpar=list(g0 = 0.3))
plot(CH, border = 10, gridl = FALSE, varycol = FALSE)
## discretize and plot
CH1 <- discretize(CH, spacing = 10, output = 'count')
plot(CH1, add = TRUE, cappar = list(col = 'orange'), varycol =
FALSE, rad = 0)
plot(traps(CH1), add = TRUE)
## show how detections are snapped to new detectors
newxy <- traps(CH1)[nearesttrap(xy(CH),traps(CH1)),]
segments(xy(CH)[,1], xy(CH)[,2], newxy[,1], newxy[,2])
Run the code above in your browser using DataLab