[R] USA map with all states

Jim Lemon jim at bitwrit.com.au
Wed Jan 2 10:49:50 CET 2008


Edna Bell wrote:
> Hi R Gurus!
> 
> There was a function in S called "usa()" which would plot the US.
> 
> I found map('usa') in R for the lower 48 states.  Is there a way to
> include Alaska and Hawaii as well, please?
> 
Hi Edna,
This is not a great plot, but it sort of does what you want.

library(maps)
data(worldMapEnv)
data(stateMapEnv)
layout(matrix(c(1,2),ncol=2),widths=c(1,3))
map("world",xlim=c(-170,-140),ylim=c(10,80))
map("state")

Jim




More information about the R-help mailing list