Blog Archives

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 »

Consistent naming conventions in R

July 15, 2014
By
Consistent naming conventions in R

Naming conventions in R are famously anarchic, with no clear winner and multiple conventions in use simultaneously in the same package. This has been written about before, in a lucid article in the R Journal, a detailed exploration of names in R source code hosted on CRAN and general discussion on stackoverflow. Basically, there are 5 naming...

Read more »

Cleaning up oversized github repositories for R and beyond

June 25, 2014
By
Cleaning up oversized github repositories for R and beyond

The version control system Git is an amazing piece of software for tracking every change that you make to a project and saving its entire history. It is incredibly useful, for users of R and other programming languages, leading it shoot from 0 market share in 2005 (when it was first released) to market domination in one short decade. However, Git can cause confusion....

Read more »

Regular expressions in R vs RStudio

April 14, 2014
By
Regular expressions in R vs RStudio

The 'regex' family of languages and commands is used for manipulating text strings. More specifically, regular expressions are typically used for finding specific patterns of characters and replacing them with others. These technique have a range of applications and R's base installation has powerful regex tools (not to mention add-on packages for string manipulation such as stringr). Yet regex in R is cause of...

Read more »

Regular expressions in R vs RStudio

April 14, 2014
By
Regular expressions in R vs RStudio

The 'regex' family of languages and commands is used for manipulating text strings. More specifically, regular expressions are typically used for finding specific patterns of characters and replacing them with others. These technique have a range of applications and R's base installation has powerful regex tools (not to mention add-on packages for string manipulation such as stringr). Yet regex in R is cause of...

Read more »

Aggregating spatial points by clusters

March 21, 2014
By
Aggregating spatial points by clusters

With ubiquitous collection devices (e.g. smartphones), having too much data may become an increasingly common problem for spatial analysts, even with increasingly powerful computers. This is ironic, because a few short decades ago, too little data was a primary constraint. This tutorial builds on the 'Attribute joins' section of the Creating maps in R tutorial to demonstrate how clusters can be...

Read more »

Aggregating spatial points by clusters

March 21, 2014
By
Aggregating spatial points by clusters

With ubiquitous collection devices (e.g. smartphones), having too much data may become an increasingly common problem for spatial analysts, even with increasingly powerful computers. This is ironic, because a few short decades ago, too little data was a primary constraint. This tutorial builds on the 'Attribute joins' section of the Creating maps in R tutorial to demonstrate how clusters can be...

Read more »

Aggregation of point data to polygons MKII – US states

March 14, 2014
By
Aggregation of point data to polygons MKII – US states

After a colleague of mine requested an illustration of the aggregation technique that was part of an introduction to spatial data in R, I decided to revisit aggregation. The first article I posted here on the subject used data from London; this one is slightly different, using Twitter data aggregated to the state level in the USA. All example code...

Read more »

Aggregation of point data to polygons MKII – US states

March 14, 2014
By
Aggregation of point data to polygons MKII – US states

After a colleague of mine requested an illustration of the aggregation technique that was part of an introduction to spatial data in R, I decided to revisit aggregation. The first article I posted here on the subject used data from London; this one is slightly different, using Twitter data aggregated to the state level in the USA. All example code...

Read more »

R for spatial analysis tutorial + video

January 30, 2014
By

On 24th January 2014 I ran a one day practical course on an "Introduction to Spatial Data Visualisation in R" at the University of Leeds, with the help of demonstrators Rachel Oldroyd and Alistair Leak, who came up from London for the event. The course is designed for people completely new to R, who are especially interested in its spatial...

Read more »