knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

ukboundaries

Travis build status

The goal of ukboundaries is to ease access to official geographic UK data. As some in the Free and Open Source Software for Geospatial community (FOSS4G) would say: "geo for all"!

This data is provided under the terms of the Open Government Licence. See https://www.ons.gov.uk/methodology/geography/licences for further details.

Installation

You can install ukboundaries from github with:

# install.packages("devtools")
devtools::install_github("robinlovelace/ukboundaries")

Data sources

An up-to-date list of data sources - each of which typically corresponds to a geographic object representing boundaries of some type - is kept in the file inst/extdata/data_sources.csv. This system file is installed with the package and can be read at any time, e.g. with:

f = system.file("extdata", "data_sources.csv", package = "ukboundaries")
data_sources = readr::read_csv(f)

You can see the contents, e.g. with:

head(data_sources)

Example

This is a basic example which shows you how to solve a common problem:

library(ukboundaries)
lsoas <- getsubgeographies("E09000001", "LSOA11") # get LSOAs in City of London
spatialdata <- getspatialdata(lsoas, "Boundaries", "GeneralisedClipped") # get shapefile
plot(spatialdata$geometry)
#plot(msoa2011_vsimple)


Robinlovelace/ukborders documentation built on May 28, 2019, 2:28 p.m.