[R-sig-Geo] starting with Rmap

Roger Bivand Roger.Bivand at nhh.no
Mon May 14 14:18:54 CEST 2007


On Mon, 14 May 2007, Laurence Amilhat wrote:

> thank you for your quick answer.
> 
> By following your steps, I was able to plot the shapefile.
> But it didn't contain what I was expected: an european map.

Please do not drop list threads, please do include your code verbatim. 

I guess that you have a map of North Carolina (as distributed with the
package). Your original question suggested that you have a shapefile of
Europe already. If you do not have, do you need just a shoreline, or do
you need country boundaries, and if so which boundaries, and from when?  
This thread may also be relevant:

http://article.gmane.org/gmane.comp.lang.r.general/84644

Roger

> 
> Do you have any idea where I can found such a map?
> A map of europe that can be read in R, so I can plot more infos on it.
> 
> thanks again,
> 
> 
> Laurence Amilhat.
> 
> 
> 
> 
> Roger Bivand a écrit :
> > On Mon, 14 May 2007, Laurence Amilhat wrote:
> >
> >   
> >> Hello,
> >>
> >> I am a beginner in R programming, so sorry for the low level of this post...
> >>     
> >
> > That's OK, everyone begins sometime ...
> >
> > Perhaps you would find the information in the CRAN "Spatial" Task View 
> > useful.
> >
> > To read and plot a shapefile, I think that you may find the examples in 
> > the help page of readShapePoly() in the maptools package helpful. This 
> > package depends on the sp package, which provides classes for spatial 
> > data. In your case:
> >
> > list.files(pattern="shp$")
> > # will tell you if your shapefile is in the working directory
> > getinfo.shape("europe.shp")
> > # will tell you what kind of shapefile it is
> > europe <- readShapePoly("europe.shp", proj4string=CRS("+proj=longlat"))
> > # will read it
> > plot(europe)
> > # will plot it
> >
> > Some of the work in the original Rmap package is now in the rgdal package, 
> > so that if you need to project the data, you can go on to that package 
> > later.
> >
> > To plot information, simply overplot the outline map with you choice of 
> > base graphics functions.
> >
> > Roger
> >
> >   
> >> I would like to create a Europe map and plot some Informations on it, 
> >> using lat/long coordinates.
> >> I've seen the Rmap project, which seems to do what I want.
> >> The thing is that I can't get started.
> >> I download the packages: maps, mapdata, spmaps, shapefiles
> >> I have a text file for the europe continent downloaded from the World 
> >> data bank, but I don't know how to create a database that can be used by 
> >> Rmap.
> >> So I tried with shapefiles, I have a shapefile for Europe, as is it 
> >> noticed in the tutorial http://www.maths.lancs.ac.uk/Software/Rmap/
> >> i tried:
> >>  >europe <- shapefile("europe.shp")
> >> Erreur : impossible de trouver la fonction "shapefiles"
> >> = The function shapefile was not found.
> >>
> >> Do someone have an idea on what I am doing wrong, or know a good 
> >> tutorial that can be helpfull for what I what to do.
> >>
> >> Many thanks,
> >>
> >>
> >> Laurence Amihat
> >>
> >> _______________________________________________
> >> R-sig-Geo mailing list
> >> R-sig-Geo at stat.math.ethz.ch
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >>     
> >
> >   
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list