Re: [R] How to draw a map of Europe?

From: Spencer Graves <spencer.graves_at_structuremonitoring.com>
Date: Sat, 19 Mar 2011 19:47:22 -0700

       I've created historical maps using R, but it required careful research, translating the boundaries into longitude and latitude shape files, then plotting them, similar to the example that David just provided. It seemed to be the easiest way I knew to produce the desired result, but it still took a moderate level of effort.

       Hope this helps.
       Spencer Graves


On 3/19/2011 6:51 PM, David Winsemius wrote:
>
> On Mar 19, 2011, at 8:32 PM, Sally Luo wrote:
>
>> Hi R users,
>>
>> I need to draw a map of select European countries with country names
>> shown
>> on the map. Does anyone know how to do this in R?
>
> Adding a tiny bit to the material produced from a search and finding
> something from Roger Bivand in response to Rense Nieuwenhuis:
>
> http://finzi.psych.upenn.edu/R/Rhelp02/archive/85586.html
>
> require(maps)
>
> country2001 <- c("Austria", "Belgium", "Switzerland",
> "Czechoslovakia", "Germany", "Denmark", "Spain", "Finland", "France",
> "UK", "Greece", "Hungary", "Ireland", "Israel", "Italy",
> "Luxembourg", "Netherlands", "Norway", "Poland", "Portugal",
> "Sweden", "Slovenia")
> color2001 <- c("green", "yellow","red","red", "red", "red", "red",
> "red", "green", "red", "red", "red", "red", "red", "red", "red",
> "red", "blue", "red", "red", "red", "orange")
>
> europe$names[grep("Sicily", europe$names)] <- "Italy:Sicily"
> europe$names[grep("Sardinia", europe$names)] <- "Italy:Sardinia"
> match <- match.map(europe,country2001)
> color <- color2001[match]
> map(database="world", fill=TRUE, col=color, xlim=c(-25,70),ylim=c(35,71))
>
> text(0, 45, "France")
>
>
>>
>> Also, is it possible to draw a historical map of European countries

>> using R?
>>
>> Thanks a lot for your help.
>>
>> Maomao
>>
>> [[alternative HTML version deleted]]
>>
> David Winsemius, MD
> West Hartford, CT
>
> ______________________________________________
> 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.
>



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. Received on Sun 20 Mar 2011 - 02:51:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 20 Mar 2011 - 03:00:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive