Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are many ways to do this in R (see the <a href="http://cran.r-project.org/web/views/Spatial.html" rel="noreferrer">spatial view</a>); many of these <a href="http://cran.r-project.org/web/packages/maps/index.html" rel="noreferrer">depend on the "maps" package</a>.</p> <ul> <li><p>Check out this <a href="http://www.ai.rug.nl/~hedderik/R/US2004/" rel="noreferrer">cool example of the US 2004 election</a>. It ends up looking like this:<a href="http://www.ai.rug.nl/~hedderik/R/US2004/US04Election-PopGraded.png" rel="noreferrer">alt text http://www.ai.rug.nl/~hedderik/R/US2004/US04Election-PopGraded.png</a></p></li> <li><p>Here's a slightly ugly example of a model <a href="http://addictedtor.free.fr/graphiques/sources/source_146.R" rel="noreferrer">that uses the "maps" package with "lattice".</a></p></li> <li>Andrew Gelman made some very nice plots like this. See, for instance, <a href="http://www.stat.columbia.edu/~cook/movabletype/archives/2009/03/how_went_the_20.html" rel="noreferrer">this blog post on red states/blue states</a> and <a href="http://www.stat.columbia.edu/~cook/movabletype/archives/2009/05/discussion_and.html" rel="noreferrer">this follow up post</a>.</li> <li><p>Here's a very simple example <a href="http://cran.r-project.org/web/packages/gmaps/index.html" rel="noreferrer">using the "gmaps" package</a>, which shows a map of Arrests by state for arrests per 100,000 for Murder:</p> <pre><code>require(gmaps) data(USArrests) attach(USArrests) grid.newpage() grid.frame(name="map") grid.pack("map",USALevelPlot(states=rownames(USArrests),levels=Murder,col.fun=reds),height=unit(1,'null')) grid.pack("map",gradientLegendGrob(at=quantile(Murder),col.fun=reds),side="bottom",height=unit(.2,'npc')) detach(USArrests) </code></pre></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload