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! Mathijs -- View this message in context: http://r.789695.n4.nabble.com/Projecting-data-on-a-world-map-using-long-lat-tp3081298p3081298.html Sent from the R help mailing list archive at Nabble.com.
The symbols function can add circles to an existing plot with the diameter based on another variable. You may need to project points if you draw a map with a projection. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of mathijsdevaan > Sent: Thursday, December 09, 2010 7:21 PM > To: r-help at r-project.org > Subject: [R] Projecting data on a world map using long/lat > > > 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! > > Mathijs > -- > View this message in context: http://r.789695.n4.nabble.com/Projecting- > data-on-a-world-map-using-long-lat-tp3081298p3081298.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.
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