[1] 44 39 38 32 22 21 21 21 15 15 14 14 14 12 12 12 12
The "SpatialPointsDataFrame" object clust.geo.test holds the events.
A list coordinates of the events of each cluster is generated with:
sapply(sorted.list.of.clusters, function(x) {clust.geo.test at coords[which(my.cluster == x),]})
[[1]]
Ost Nord
[1,] 322737.4 6406939
[2,] 323104.9 6406968
[3,] 323104.9 6406968
...
[[2]]
Ost Nord
[1,] 315359.9 6393110
[2,] 315177.0 6394031
[3,] 314697.8 6394565
...
And I can plot the points in the hot-spots with
But would like to plot each cluster as a polygon, ideally filled with
darker colors for clusters with higher number of fires.
I guess I need to create polygons for each cluster and then plot each
polygon. How do you do that?
For your convenience I have created a RData object containing the
objects refered to above and uploaded to this URI
http://sociologi.cjb.net/temp/to-polygons-help.RData, so
print(load(url("http://sociologi.cjb.net/temp/to-polygons-help.RData")))
plot(sdn)
sapply(sorted.list.of.clusters, function(x) {plot(clust.geo.test[which(my.cluster == x),], add = T)})
would get you to the point I am now.
Hans Ekbrand
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20100423/bc728e00/attachment.bin>