Did you try USA:Alaska?
That should work. I don't have the latticeExtra package installed so I
cannot easily test
your code, but map("world", c("USA", "Hawaii"),
fill=TRUE) looks OK to me. However you
don't actually show the code you are using when attempting to colour Alaska.
HTH,
Ray Brownrigg
Xin Sun wrote:> 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 at 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.