This is a worked example using spatial modelling techniques to investigate the uptake of broadband in Ireland. The data are obtained from the 2016 Irish Census, and each observation applies to a single Electoral Division (ED) - these are geographical areas – there are 3,440 of them in Ireland. A number of variables are supplied here, but the main ones to be used here are

In addition, the actual house count, and number of houses with broadband (both integers) that were used to compute Broadband are available as Broadband_Count and Broadband_Denom respectively. Thus, Broadband was computed using:

Broadband <- Broadband_Count / Broadband_Denom

A first look at the data

The data can be obtained through this link and is in an R data file named ireland_ct_ed.RData. Assuming you have downloaded this and put in into the R folder you are working with, load it using:


Note that there are 4 data items in this file. All of these are simplefeature R objects - these are similar to data frames, but also contain geographical information. At this point it may be useful to load up some libraries that will help to manipulate and analyse these.


tidyverse is a library you will likely have already used. sf implements the simplefeatures geographical data structure, and provides some functions to manipulate this. tmap provides map drawing tools, and works well together with sf.

We can take a first look at the data. The data you have loaded contains four objects ED_2016, CTY_2016 and ED_ll, CTY_ll. All of these are sf objects. We can use tmap to draw CTY_2016:

tm_shape(CTY_2016) + tm_polygons()