[R] Introduction to maps (of Denmark)?
Greg.Snow at imail.org
Fri Feb 6 23:22:11 CET 2009
Googling for Denmark Shapefile leads to this website: http://www.vdstech.com/map_data.htm
Where a few clicks lead to downloading a set of shapefiles (different levels of subdividing the country, hopefully you know more about what they correspond to than I do, about all I know about Denmark is from Hamlet, the fact that I have some ancestors from there (but I don't remember which branch), and how to make aebleskivers).
These can be read into R using the maptools package as:
dmk1 <- readShapePoly('g:/downloads/DNK_adm/DNK0')
dmk2 <- readShapePoly('g:/downloads/DNK_adm/DNK1')
dmk3 <- readShapePoly('g:/downloads/DNK_adm/DNK2')
simple plots can be done like:
a little more complex with:
though of course replacing topo.colors(248) with something that is meaningful. If you need more control, then see the sp package.
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 Peter Jepsen
> Sent: Friday, February 06, 2009 1:18 PM
> To: r-help at r-project.org
> Subject: [R] Introduction to maps (of Denmark)?
> Dear R-listers,
> I am using R for Windows Vista 64-bit. I have no experience working
> maps, but now I have to plot a map of Denmark in which each Danish
> county is color-coded according to its incidence rate of a particular
> disease. My problem is that I don't know where to start. I have read
> help files to packages like 'mapplot', and their examples indicate that
> I am on the right track, but where do I find a suitably detailed map of
> Denmark, and which format should I prefer? The terminology in the help
> files etc. is overwhelming.
> Thank you in advance for any help.
> Best regards,
> R version 2.8.1 (2008-12-22)
> attached base packages:
>  stats graphics grDevices utils datasets methods base
> 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