Assignment 5 Q1.3

posted Sep 30, 2012, 5:58 PM by Unknown user
You may experience some unexpected results when you try to plot the clusters on the map.  You may want to try adding each cluster incrementally using the following code (where k is the number of clusters)
 
map(database = "world")
for (i in 1:k){
  map.cities(x = major.cities[which(major.cities.pam$clustering==i),], country = "", label = NULL, minpop = 0,maxpop = Inf, capitals = 0, cex = par("cex"), projection = FALSE,parameters = NULL, orientation = NULL, pch = 1, col=i)
}
(you need to add the cluster centers too...)
Comments