data(nydf)
data(nyw)
coords <- with(nydf, cbind(x, y))
out <- bn.test(
coords = coords, cases = nydf$cases,
pop = nydf$pop, cstar = 6,
alpha = 0.1
)
plot(out)
# better plotting
if (require("sf", quietly = TRUE)) {
data(nysf)
plot(st_geometry(nysf), col = color.clusters(out))
}
Run the code above in your browser using DataLab