i've search the email archives, searched the documention of various map packages and done an R-site search, but have been unable to find direct resources for creating maps of the US that are colored or annotated or ... by zipcode data. For example, create a map of the US and color each zipcode region by its population using two vectors z,p containing the zipcode and population, respectively. I'm not looking for data to fill z, and p. I'm looking for some highend functions to display on a map the data that I already have. Cheers, Mike
library(maps) example(match.map) #for coloring If you want to annotate the map look at ?map.text I hope this helps Francisco>From: Mike R <mike.rstat at gmail.com> >Reply-To: r-help at stat.math.ethz.ch >To: r-help at stat.math.ethz.ch >Subject: [R] us zipcode data map >Date: Fri, 10 Jun 2005 15:18:26 -0700 > >i've search the email archives, searched the documention >of various map packages and done an R-site search, but >have been unable to find direct resources for creating maps >of the US that are colored or annotated or ... by zipcode >data. > >For example, create a map of the US and color each zipcode >region by its population using two vectors z,p containing the >zipcode and population, respectively. I'm not looking for data >to fill z, and p. I'm looking for some highend functions to >display on a map the data that I already have. > >Cheers, >Mike > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html
On 6/10/05, Francisco J. Zagmutt <gerifalte28 at hotmail.com> wrote:> library(maps) > example(match.map) #for coloring > > If you want to annotate the map look at ?map.textthanks Francisco, correct me if i am wrong, but maps_2.0-27.tar.gz does many many maps, but not any zipcode maps ?
On Fri, 10 Jun 2005, Mike R wrote:> i've search the email archives, searched the documention > of various map packages and done an R-site search, but > have been unable to find direct resources for creating maps > of the US that are colored or annotated or ... by zipcode > data. > > For example, create a map of the US and color each zipcode > region by its population using two vectors z,p containing the > zipcode and population, respectively. I'm not looking for data > to fill z, and p. I'm looking for some highend functions to > display on a map the data that I already have.I'm replying to this original message, because your followups have been dropping the original query (please don't assume that everybody uses the e-mail system you have chosen yourself). With the points you have found, you can delineate surrounding polygons and clip to the coastline using functions in the tripack, gpclib, and maps packages (being very careful to find out how to match the output polygon IDs to your data). But unless you are aiming for A0 postscript output, for the continental US viewed as a whole, almost all raster image processors will merge the interesting metropolitan zip polygons, leaving the viewer looking at a mess with only the areas with lowest population density legible. Even zip code "maps" of small states are very difficult to use for look-up (reading values from the polygon fill), one of the main functions of thematic cartography. So like most tasks, it can be done (this _is_ R, after all), but do you really need to do it? Roger> > Cheers, > Mike > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- 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
Not that I am aware of. Try library(help="maps") for a list of all the functions in the library. Anyhow, I am not sure that a US map with zipcodes will look very good/readable, unless you focus on a very small area (i.e. county). Cheers Francisco>From: Mike R <mike.rstat at gmail.com> >Reply-To: r-help at stat.math.ethz.ch >To: r-help at stat.math.ethz.ch >Subject: Re: [R] us zipcode data map >Date: Fri, 10 Jun 2005 18:06:39 -0700 > >On 6/10/05, Francisco J. Zagmutt <gerifalte28 at hotmail.com> wrote: > > library(maps) > > example(match.map) #for coloring > > > > If you want to annotate the map look at ?map.text > >thanks Francisco, correct me if i am wrong, but maps_2.0-27.tar.gz >does many many maps, but not any zipcode maps ? > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html
I have had success by downloading the zipcode (approximate) shapefiles (the .shp files) from: http://www.census.gov/geo/www/cob/z52000.html Then using the maptools package (rather than the maps package). hope this helps, Greg Snow, Ph.D. Statistical Data Center, LDS Hospital Intermountain Health Care greg.snow at ihc.com (801) 408-8111>>> mike.rstat at gmail.com 06/10/05 04:18PM >>>i've search the email archives, searched the documention of various map packages and done an R-site search, but have been unable to find direct resources for creating maps of the US that are colored or annotated or ... by zipcode data. For example, create a map of the US and color each zipcode region by its population using two vectors z,p containing the zipcode and population, respectively. I'm not looking for data to fill z, and p. I'm looking for some highend functions to display on a map the data that I already have. Cheers, Mike ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
The first hit in RSiteSearch("html") guides you to the package R2HTML. Take a look at HTMLInsertGraph {R2HTML}. Try RSiteSearch("pdf") for pdf devices. Hint: savePlot("MyPlot","pdf") Cheers Francisco>From: Mike R <mike.rstat at gmail.com> >Reply-To: r-help at stat.math.ethz.ch >To: "Francisco J. Zagmutt" <gerifalte28 at hotmail.com> >Subject: Re: [R] us zipcode data map >Date: Mon, 13 Jun 2005 00:17:53 -0700 > >On 6/12/05, Francisco J. Zagmutt <gerifalte28 at hotmail.com> wrote: > > Not that I am aware of. Try library(help="maps") for a list of all the > > functions in the library. Anyhow, I am not sure that a US map with >zipcodes > > will look very good/readable, unless you focus on a very small area >(i.e. > > county). > >Hi Francisco - the map dimensions are about 150x50 miles. > >But what i've learned is that a zipcode region has area=0 because >a zipcode region is a group of street addresses. instead of a region, >it is more like a tree. > >My current plan of action is to use readily available government >ascii tables. From those tables, I can obtain a single latitude and >longitude for each zipcode, and a government "estimate" of the >"land area" in square miles. > >From there, it should be easy to display the data on one of the maps in >the package that you recommended (thanks). If not, there are other >options for the "base map". > >My new task (which I have not investigated yet) is to see if facilities >exist in R to turn the X11 device into an HTML document with an >html-map .... or into a PDF with hyperlinks. > >Cheers, >Mike