[R-sig-Geo] Adding some data as colors to world map

Miha Staut mihastaut at yahoo.co.uk
Tue Mar 7 09:22:21 CET 2006


> > There are plenty of sources of 
> > border maps, but getting something matching the borders you need may 
> > require a bit of googling (usually looking for a vector representation).
> 
> Yes, my country is missing ;)
> 
> > Does anybody have recommended websites for current European national 
> > border data (preferably in a format we can read)?
> 
> Hmm, this is then the main bottleneck - the maps.
> 
> > 
> >>Many thanks!
> >>
> >>

Try this link http://thuban.intevation.org/download.html and search for the
freegis_worlddata either simplified or the detailed map. You may find Slovenia
on both of them. Import the shapefiles with the command read.shape from the
maptools library. The data you want to display in colour are stored in
imported.shp$att.data. So add the column with your data to this data.frame and
plot it with plot as explained in help pages of plot.Map. 

library(maptools)
w.data <- read.shape("countries.shp")
# edit data in w.data$att.data
plot(w.data, auxvar=w.data$att.data$your.variable) 
# play with aditional arguments of plot.Map as "recs" to plot only the european
part, either "fg" or "color" for the color ramp, "type" etc. 

All best, Lep pozdrav,
Miha Staut




More information about the R-sig-Geo mailing list