Quantcast

How to draw a map of Europe?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to draw a map of Europe?

Sally Luo
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?

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]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to draw a map of Europe?

Mike Marchywka







----------------------------------------

> Date: Sat, 19 Mar 2011 19:32:43 -0500
> From: [hidden email]
> To: [hidden email]
> Subject: [R] How to draw a map of Europe?
>
> 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?
>
> Also, is it possible to draw a historical map of European countries using R?

This came up on this list a while ago and I was just using that example
for some work I'm doing but I have only copied what was posted
and added minor things to it. I can't give you actual answer
but you are probably just a few key words away from a google searhc.
 The term you are probably looking for
is "shapefile." Try that on google. For example,

http://www.google.com/#sclient=psy&hl=en&q=shapefile+cran+europe

turns up things that may help.




>
> Thanks a lot for your help.
>
> Maomao

     
______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to draw a map of Europe?

David Winsemius
In reply to this post by Sally Luo

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]]
>
> ______________________________________________
> [hidden email] 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.

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to draw a map of Europe?

Spencer Graves-2
       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
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to draw a map of Europe?

Michael Friendly
In reply to this post by Sally Luo
On 3/19/2011 8:32 PM, Sally Luo wrote:
> Also, is it possible to draw a historical map of European countries using R?

If you want a map of France ~ 1830, see
http://www.datavis.ca/gallery/guerry/guerrymap.html

______________________________________________
[hidden email] 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.
Loading...