color.clusters {smerc} | R Documentation |
color.clusters
is a helper function to color
clusters of regions produced by an appropriate method,
e.g., scan.test
or uls.test
. Regions that
are not part of any cluster have no color.
color.clusters(x, col = 2:(length(x$clusters) + 1))
x |
An object of class scan produced by a function
such as |
col |
A vector of colors to color the clusters in
|
Returns a vector with colors for each
region/centroid for the data set used to construct
x
.
Joshua French
data(nydf) coords = with(nydf, cbind(longitude, latitude)) out = scan.test(coords = coords, cases = floor(nydf$cases), pop = nydf$pop, alpha = 0.12, longlat = TRUE, nsim = 9) data(nypoly) library(sp) plot(nypoly, col = color.clusters(out))