[R] help identifying clusters

2010-10-20 Thread jonas garcia
Dear list: I have a dataset of geographical data that looks like this example data: dat- data.frame( lon = c(rnorm(1000, mean=-10), rnorm(1000, mean=10), rnorm(1000, mean=5)), lat = c(rnorm(1000, mean=40), rnorm(1000, mean=30), rnorm(1000, mean=0))) plot(dat$lon, dat$lat) My positions are

Re: [R] help identifying clusters

2010-10-20 Thread Nikhil Kaza
Look at clustering task view http://cran.r-project.org/web/views/Cluster.html A simple way to do it is library(cluster) dat$cluster - pam(dat, 3, stand=T)$clustering plot(dat$lon, dat$lat, col=dat$cluster) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina