Entries in Spatial (3)


Notes from A Recent Spatial R Class I Gave

Below is a link to a pdf (compiled with the amazing knitr package) and some accompanying data for a recent short course I gave on basic spatial data import/analysis/visualization in R. The class was only two hours and some of the participants were being exposed to R for the first time so the material is limited. The class was a follow up to a previous one I did on ArcGIS. The idea was to show how to perform the same functions in R and ArcGIS and then let users decide which worked best for them (I use R for about 90% of my spatial analysis and data handling but find ArcGIS (or some GUI based GIS) pretty essential for that last 10%). 

The content/main points of the course:

  • Basic intro to R
  • Reading in a Shapefile
  • Doing a table join with a shapefile and a data.frame
  • Generating random points
  • Doing a point in polygon spatial join
  • Reading and cropping raster data
  • Doing a pixel in polygon spatial join (using extract() from the raster pacakge)
  • Plotting and annotating a shapefile in ggplot2
  • Making panel maps in ggplot2

The notes contain all the R-code and a lot of grammatical and spelling errors. I hope to improve and update this class over time. Please let me know if:

  1. You find the material useful
  2. You use it/modify for a class of your own (and please share the results)
  3. You have any major suggestions for improvements (I'm aware of most of the minor issues)



Property rights and the economic origins of the Sicilian mafia

This is fascinating. Originally posted on FT Alphaville, the paper seems like a great example of work that intersects econ, physical geography, and political science.  I'll just post the link for now, and revisit once I've had time to read the actual paper.


Spatial Tunnel Vision

Geography has a problem I call 'spatial tunnel vision'. In a nerdy nutshell you could summarize it as the failure to realize the absence of Tobler's Law as a null-hypothesis that should be rejected. Somewhat more plainly put: We always assume spatial correlation, and what's worse, we almost always assume that correlation is the result of some underlying spatial process, rather than the result of some unobserved and spatially concentrated influence.

For example, unemployment often exhibits high spatial correlation. Does this mean that if your neighbor loses her job it will likely happen to you too, simply because you live next door? No, people with similar incomes, and often those who work in similar industries, tend to live in close proximity to one another. So the same forces that impacted your neighbors employer might also impact yours.

This may seem like an obvious argument, but I see this mistake alot. People, usually geographers, use the fact that many things are spatially correlated to argue that 'place matters' and 'spatial is special'. Well, sort of. In the above example, yes place does matter, but only as a special case of cross-sectional correlation, that if properly controlled for, will not impact whatever broader statistical inference you want to make with the data.

I think this problem stems from the back-seat that Geography had in academia for much of the 20th century. Prior to the quantitative revolution (in geography) and especially the availability of consumer accessible GIS packages, Geographers spent alot of time persuading others that what they did was relevant. This has created a great sense of camaderie within the community, but, especially after the rise of GIS and Remote Sensing, has created a sense that every other discipline is misguided until they see the spatial light.

I use to feel this way. As a PhD student in a prominent geography department I see (and sympathize) with this view alot. It was not until I really delved into statistics and started working with economists that I realized that yeah, spatial is special, but not all time, and the burden of proof lies with the geographers. And, even if spaital is not special, there may still be a lot of interesting questions to ask of spatially correlated data.