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?
Thanks,
Edna Bell
USA map with all states
4 messages · Edna Bell, Jim Lemon, Greg Snow
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
What are you trying to accomplish with this map? Realize that if you include Alaska and Hawaii in their actual locations using common projections, then some states will be pretty much lost due to scale and position. If you are trying to show actual geographic locations relative to the states, then this is appropriate (but the effectiveness can depend greatly on choice of projection). If on the other hand, you want to color the states or include other graphics and just need the map for visual reference (general location, neighbors, etc.) then you may want to use a different type of map. The state.vbm map in the TeachingDemos package works with the maptools and sp packages to draw a Visibility Based Map (originally created by Mark Monmonier) that gives a map with the general shape and locations of the states (including Alaska and Hawaii in the lower left, not their actual locations), but with small states made larger and large states made smaller so that they have similar visual impact. See the help on state.vbm for more detail, examples, and links to further resources. Hope this helps,
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Edna Bell
> Sent: Tuesday, January 01, 2008 10:03 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] USA map with all states
>
> 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?
>
> Thanks,
> Edna Bell
>
> ______________________________________________
> 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.
>