[R] Projecting data on a world map using long/lat

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Dec 10 10:25:57 CET 2010


On Fri, Dec 10, 2010 at 2:21 AM, mathijsdevaan <mathijsdevaan at gmail.com> wrote:
>
> Hi,
>
> I have a dataset (CSV) with some counts of firms located around the globe.
> Each count is assigned to the longitude and latitude of the specific
> location. Now I want to plot these counts on a world map using dots (size of
> dots represent the count). I have been unable to find any info on whether
> this is possible and if so, how? Can you please help me? Thanks!
>

 Plotting points is trivial - plot(data$x,data$y,pch=19,cex=data$size)
will do for a start. i'm guessing your real problem is when you say
'on a world map'.

 How detailed a world map do you need? There's an outline one in the
'maps' package, or you should be able to find a shapefile of the world
on the web somewhere and use that via the rgdal package.

 Other options include making a KML file of your points and overlaying
on google earth. Or getting google map tiles and overlaying on
that.... Or exporting your data to a GIS format and doing the pretty
map in something like Quantum GIS. What are you trying to do exactly?

also, you might want to post to r-sig-geo



Barry



More information about the R-help mailing list