cso_get_geo: Return geographic data as a sf data frame

View source: R/cso_get_geo.R

cso_get_geoR Documentation

Return geographic data as a sf data frame


Retrieves an ESRI shapefile of vector data for Ireland from the cso website cso.ie and returns it as an sf data frame. The data is returned as a zip file, which is downloaded to and unzipped in a temporary directory.


cso_get_geo(map_data, cache = TRUE, flush_cache = TRUE)



string. Indicates which shapefile to download. Options are:

  • "Provinces" OR "p",

  • "NUTS2",

  • "NUTS3",

  • "NUTS2_2011",

  • "NUTS3_2011",

  • "Administrative Counties" OR "admin_counties" OR "ac",

  • "Electoral Divisions" OR "elec_div" OR "ed",

  • "Small Areas" OR "sa" and

  • "Gaeltacht" OR "g".

Until v0.1.5 "NUTS2" and "NUTS3" gave access to the 2011 dataset.


logical. Indicates whether to cache the result using R.cache. TRUE by default.


logical. If TRUE (default) the cache will be checked for old, unused files. Any files which have not been accessed in the last month will be deleted


The map data is from the 2011 census, and is 20m generalised, which offers a good balance of fidelity and low file size. More datasets, as well as 50m generalised, 100m generalised and ungeneralised versions of the map files can also be found on the OSi (Ordnance Survey Ireland) website at https://data-osi.opendata.arcgis.com/search?tags=boundaries.

The NUTS2 and NUTS3 map files are the updated versions for 2016, including three NUTS2 regions and the movement of Louth and South Tipperary into new NUTS3 regions. These files are downloaded directly from the OSi website, as they are not available on the CSO website, and do not contain the population and housing data contained in the map files from the CSO website.


data frame of the requested CSO table.


## Not run: 
shp <- cso_get_geo("NUTS2")

## End(Not run)

csodata documentation built on June 10, 2022, 5:09 p.m.