Hello: I have a problem when I tried to color the USA map with different colors. The following is my data (I only used the second column of data):
alaska, 1, 2 Hawaii, 0, 0 USA, 5, 5 And here is my code: library("latticeExtra") library("mapproj") state<-read.table("C:\\usaclass.txt",sep=",") state range<-with(state,range(state[1:3,3])) range nbreaks=6 breaks<-do.breaks(range,nbreaks) StateName<-state[1:3,1] StateName mapplot(StateName~state[1:3,3],data=state,breaks=breaks, map=map("world", c("USA", "Hawaii"), fill=TRUE) ,scales=list(draw=FALSE), colramp = colorRampPalette(c("white", "black")),xlab=NULL) After I run this code, the continental USA could be colored, but alaska is not colored. I have tried to write alaska as "Alaska" and "USA:alaska". However, it does not work. Do you have any suggestion? Thanks! Sun ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.