548 search results for "spatial"

Stop and Frisk: Spatial Analysis of Racial Discrepancies

June 23, 2015
By
Stop and Frisk: Spatial Analysis of Racial Discrepancies

In my last post, I compiled and cleaned publicly available data on over 4.5 million stops over the past 11 years. I also presented preliminary summary statistics showing that blacks had been consistently stopped 3-6 times more than whites over the last decade in NYC. Since the last post, I managed to clean and reformat the … Continue reading...

Read more »

Plotting spatial neighbors in ggmap

June 15, 2015
By
Plotting spatial neighbors in ggmap

The R package spdep has great utilities to define spatial neighbors (e.g. dnearneigh, knearneigh, with a nice vignette to boot), but the plotting functionality is aimed at base graphics. If you’re hoping to plot spatial neighborhoods as line segments in ggplot2, or ggmap, you’ll need the neighborhood data to be stored in a data frame. So, to...

Read more »

MazamaSpatialUtils Package

February 11, 2015
By
MazamaSpatialUtils Package

This entry is part 15 of 15 in the series Using RMazama Science has just released its first package on CRAN — MazamaSpatialUtils. Here is the description: A suite of conversion scripts to create internally standardized spatial polygons dataframes. Utility …   read more ...

Read more »

Spatial visualization with R – Tutorial

December 10, 2014
By
Spatial visualization with R – Tutorial

The visualization of spatial data is one of the most popular applications when using R. This tutorial is an introduction to the visualization of spatial data and map making in R. The following issues will be addressed: Import anduse of shapefiles in R (shapefile is a file format designed for spatial data). Data management and

Read more »

Spatial data extraction around buffered points in R

November 8, 2014
By

Quantifying spatial data (e.g. land cover) around points can be done in a variety of ways, some of which require considerable amounts of patience, clicking around, and/or cash for a license. Here’s a bit of code that I cobbled together to quickly extract land cover data from the National Land Cover Database for buffered regions around points (e.g....

Read more »

Spatial data extraction around buffered points in R

November 8, 2014
By

Quantifying spatial data (e.g. land cover) around points can be done in a variety of ways, some of which require considerable amounts of patience, clicking around, and/or cash for a license. Here’s a bit of code that I cobbled together to quickly extract land cover data from the National Land Cover Database for buffered regions around points (e.g. small...

Read more »

Generating Hurricanes with a Markov Spatial Process

September 30, 2014
By
Generating Hurricanes with a Markov Spatial Process

The National Hurricane Center (NHC) collects datasets with all  storms in North Atlantic, the North Atlantic Hurricane Database (HURDAT). For all sorms, we have the location of the storm, every six jours (at midnight, six a.m., noon and six p.m.). Note that we have also the date, the maximal wind speed – on a 6 hour window – and...

Read more »

Spatial Clustering: Conley Standard Errors for R

September 8, 2014
By

I have been working quite a lot with climate and weather data, to study the impact of rainfall shocks on violence in India and how this relationship changed, after the social insurance scheme NREGA was introduced. In my context, it becomes particularly relevant to adjust for spatial correlation if you find yourself in a situation

Read more »

Spatial Data Visualization with R

August 31, 2014
By
Spatial Data Visualization with R

I’ve been fooling around with spatial data lately. As it turns out, there are some great R packages for visualizing this kind of data. Below is a set of charts I put together. It’s a good sample of the possibilities. Motherjones.com keeps a dataset with characteristics of every mass shooting since 1983. The location of each shooting is marked on the map … Continue reading...

Read more »

Clipping spatial data in R

July 28, 2014
By
Clipping spatial data in R

This miniature vignette shows how to clip spatial data based on different spatial objects in R and a ‘bounding box’. Spatial overlays are common in GIS applications and R users are fortunate that the clipping and spatial subsetting functions are mature and fairly fast. We’ll also write a new function called gClip(), that will make clipping by bounding boxes...

Read more »