data(nydf)
coords <- with(nydf, cbind(longitude, latitude))
out <- scan.test(
coords = coords, cases = floor(nydf$cases),
pop = nydf$pop, nsim = 0,
longlat = TRUE, alpha = 1
)
# plot only 3 most likely clusters
plot(out, idx = 1:3)
## plot output for new york state
# specify desired argument values
mapargs <- list(
database = "county", region = "new york",
xlim = range(out$coords[, 1]),
ylim = range(out$coords[, 2])
)
# needed for "county" database (unless you execute library(maps))
data(countyMapEnv, package = "maps")
# plot only the 1st and 3rd clusters
plot(out, idx = 1:3, usemap = TRUE, mapargs = mapargs)
Run the code above in your browser using DataLab