[R] help identifying clusters

Nikhil Kaza nikhil.list at gmail.com
Thu Oct 21 04:09:07 CEST 2010


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

nikhil.list at gmail.com

On Oct 20, 2010, at 6:41 PM, jonas garcia wrote:

> 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)



More information about the R-help mailing list