Publications by Robin Lovelace - R
Installing rgdal in Ubuntu 13.04
The Geospatial Data Abstraction Library (GDAL) is a workhorse of digital mapping. Written in c++, it underpins many online and desktop geoprocessing programs including QGIS and GeoServer. Through its OGR library, GDAL enables the import and export of most common spatial data formats, including the trusty ESRI Shapefile. These features and more...
3548 sym Python (1119 sym/2 pcs)
Introduction to R and ggplot2 course
This course is about getting to grips with the basics of the R command line for basic data analysis and visualisation. There's a focus on maps and ggplot2. The first part of the course uses Rich Harris's “Short Introduction to R” (here). The second part works through an “Introduction to Spatial Data and ggplot2” (Cheshire and Lovelace, 2...
936 sym
Coxcomb plots and ‘spiecharts’ in R
I was contacted recently by a housing organisation who wanted an attractive visualisation of their finances, arranged in a circular form. Because there were two 4 continuous variables to include, all of which were proportions of each other, the client suggested a plot similar to a pie chart, but with each segment extending out a different radiu...
3018 sym R (5582 sym/17 pcs) 32 img
Spatial clipping and aggregation in R
A common task in GIS is comparing the spatial extent of one layer with another. Say you have a load of points, some of which overlay a polygon layer. You are only interested in the points that intersect with the points. What do you do? Also, how can you aggregated-up the values contained in the points to correspond with the polygons. These are...
3777 sym R (1204 sym/7 pcs) 8 img
R for spatial analysis tutorial + video
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 ...
2341 sym
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 c...
1144 sym R (4090 sym/7 pcs) 6 img
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 m...
5802 sym R (2514 sym/8 pcs) 16 img
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 packa...
6396 sym R (944 sym/9 pcs) 2 img
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...
4362 sym R (361 sym/4 pcs) 6 img
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 conv...
5656 sym R (113 sym/1 pcs) 2 img