[R] creating a map
Greg.Snow at imail.org
Tue Feb 17 18:28:24 CET 2009
You need to give the symbols function the locations where you want the centers of the circles to be. Some datesets with map information also have centers of the states that you can use, for the USA, there is the state.center dataset that may work for you, or the maptools package function get.Pcent will compute a center for polygons (there are probably other similar functions in other packages).
For adding circles to a map of the USA, you may want to look at the state.vbm data in the TeachingDemos package (works with maptools package), but you will need to computer the centers of the polygons, they don't match state.center or others.
Hope this helps,
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Alina Sheyman
> Sent: Tuesday, February 17, 2009 9:53 AM
> To: r-help at r-project.org
> Subject: [R] creating a map
> I'm trying to create a fairly basic map using R. What i want to get is
> map of the country with circles representing a count of students in
> What I've done so far is as following -
> this gives me the map of the country, but one that's not populated by
> Does anyone know what I'm doing wrong?
> Also, if anyone can recommend a good reference for creating maps in R,
> really appreciate that.
> thank you
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help