data(craterA)
## change npixel to 1000 to obtain nicer plots
spatstat.geom::spatstat.options(npixel=100)
## type: dist
hrzd1 <- det_hrz(craterA, type = "dist", criterion = "area", cutoff = 1000000, nxprob = 0.1)
hrzd2 <- det_hrz(craterA, type = "dist", criterion = "indirect", cutoff = 0.9, nxprob = 0.1)
hrzd3 <- det_hrz(craterA, type = "dist", criterion = "direct", cutoff = 100, nxprob = 0.1)
op <- par(mfrow = c(2, 2))
plot(craterA)
plot(hrzd1, zonecol = 2, win = craterA$window, plotwindow = TRUE)
plot(hrzd2, zonecol = 3, win = craterA$window, plotwindow = TRUE)
plot(hrzd3, zonecol = 4, win = craterA$window, plotwindow = TRUE)
par(op)
if (FALSE) {
# or first calculate the distancemap and use it:
distm <- distmap(craterA)
hrzd <- det_hrz(craterA, type = "dist", criterion = "direct", cutoff = 100,
distancemap = distm, nxprob = 0.1)
}
## type: intens
# reduce number of observations for faster computation
thin.craterA <- craterA[1:10]
hrzi1 <- det_hrz(thin.craterA, type = "intens", criterion = "area", cutoff = 100000, nxprob = 0.1)
plot(hrzi1)
plot(thin.craterA, add = TRUE)
plot(thin.craterA$window, add = TRUE)
if (FALSE) {
hrzi2 <- det_hrz(craterA, type = "intens", criterion = "indirect", cutoff = 0.1, nxprob = 0.1)
hrzi3 <- det_hrz(craterA, type = "intens", criterion = "direct", cutoff = 0.0001, nxprob = 0.1)
plot(hrzi2)
plot(hrzi3)
}
## More detailed examples on http://highriskzone.r-forge.r-project.org/
Run the code above in your browser using DataLab