All Projects → ropensci → PostcodesioR

ropensci / PostcodesioR

Licence: other
API wrapper around postcodes.io - free UK postcode lookup and geocoder

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to PostcodesioR

nomisr
Access UK official statistics from the Nomis database through R.
Stars: ✭ 30 (-16.67%)
Mutual labels:  geographic-data, r-package, uk, peer-reviewed
rdefra
rdefra: Interact with the UK AIR Pollution Database from DEFRA
Stars: ✭ 14 (-61.11%)
Mutual labels:  r-package, uk, peer-reviewed
opencage
🌐 R package for the OpenCage API -- both forward and reverse geocoding 🌐
Stars: ✭ 82 (+127.78%)
Mutual labels:  geocoder, r-package, peer-reviewed
Ckanr
R client for the CKAN API
Stars: ✭ 91 (+152.78%)
Mutual labels:  api-wrapper, r-package
kaggler
🏁 API client for Kaggle
Stars: ✭ 50 (+38.89%)
Mutual labels:  api-wrapper, r-package
Gistr
Interact with GitHub gists from R
Stars: ✭ 90 (+150%)
Mutual labels:  api-wrapper, r-package
cablecuttr
An R wrapper for CanIStream.It API
Stars: ✭ 17 (-52.78%)
Mutual labels:  api-wrapper, r-package
Taxize
A taxonomic toolbelt for R
Stars: ✭ 209 (+480.56%)
Mutual labels:  api-wrapper, r-package
Rorcid
A programmatic interface the Orcid.org API
Stars: ✭ 101 (+180.56%)
Mutual labels:  api-wrapper, r-package
suppdata
Grabbing SUPPlementary DATA in R
Stars: ✭ 31 (-13.89%)
Mutual labels:  r-package, peer-reviewed
rdflib
📦 High level wrapper around the redland package for common rdf applications
Stars: ✭ 47 (+30.56%)
Mutual labels:  r-package, peer-reviewed
medrxivr
Access and search medRxiv and bioRxiv preprint data
Stars: ✭ 34 (-5.56%)
Mutual labels:  r-package, peer-reviewed
worrms
World Register of Marine Species R client
Stars: ✭ 13 (-63.89%)
Mutual labels:  api-wrapper, r-package
rredlist
IUCN Red List API Client
Stars: ✭ 31 (-13.89%)
Mutual labels:  api-wrapper, r-package
WikidataQueryServiceR
An R package for the Wikidata Query Service API
Stars: ✭ 23 (-36.11%)
Mutual labels:  api-wrapper, r-package
Rcrossref
R client for various CrossRef APIs
Stars: ✭ 137 (+280.56%)
Mutual labels:  api-wrapper, r-package
oai
OAI-PMH R client
Stars: ✭ 13 (-63.89%)
Mutual labels:  r-package, peer-reviewed
HerePy
A library that provides a Python interface to the HERE APIs.
Stars: ✭ 73 (+102.78%)
Mutual labels:  api-wrapper, geocoder
nlrx
nlrx NetLogo R
Stars: ✭ 66 (+83.33%)
Mutual labels:  r-package, peer-reviewed
robotstxt
robots.txt file parsing and checking for R
Stars: ✭ 65 (+80.56%)
Mutual labels:  r-package, peer-reviewed

PostcodesioR

PostcodesioR

Travis-CI Build Status Package-License Project Status: Active – The project has reached a stable, usable state and is being actively developed. CRAN_Status_Badge DOI Downloads

An API wrapper around postcodes.io - free UK postcode lookup and geocoder. This package helps to find and transform information about UK administrative geography like postcodes, LSOA, MSOA, constituencies, counties, wards, districts, CCG or NUTS.

The package is based exclusively on open data provided by postcodes.io. PostcodesioR can be used by data scientists or social scientists working with geocoded UK data. A common task when working with such data is aggregating geocoded data on different administrative levels, e.g. turning postcode-level data into counties or regions. This package can help in achieving this and in many other cases when changing the aggregation of geographic data is required.

Installation

This package can be installed from GitHub (developmental version) or CRAN (stable).

In order to install PostcodesioR use one of the following commands:

# stable version
install.packages("PostcodesioR")

or

# developmental version
if(!require("devtools")) {
  install.packages("devtools")
}
devtools::install_github("ropensci/PostcodesioR")

Loading

Load the package by typing

library(PostcodesioR)

Examples

Where possible, I tried to return a data frame. Unfortunately, a lot of API calls return more complex data and in those cases it is safer to use lists. The API limits the number of returned calls. Check functions’ documentation for more details.

For additional information about the returned data and the function calls see the original documentation.

The main function of this package provides information related to a given postcode

lookup_result <- postcode_lookup("EC1Y8LX")

#overview
str(lookup_result)
## 'data.frame':    1 obs. of  35 variables:
##  $ postcode                       : chr "EC1Y 8LX"
##  $ quality                        : int 1
##  $ eastings                       : int 532544
##  $ northings                      : int 182128
##  $ country                        : chr "England"
##  $ nhs_ha                         : chr "London"
##  $ longitude                      : num -0.0909
##  $ latitude                       : num 51.5
##  $ european_electoral_region      : chr "London"
##  $ primary_care_trust             : chr "Islington"
##  $ region                         : chr "London"
##  $ lsoa                           : chr "Islington 023D"
##  $ msoa                           : chr "Islington 023"
##  $ incode                         : chr "8LX"
##  $ outcode                        : chr "EC1Y"
##  $ parliamentary_constituency     : chr "Islington South and Finsbury"
##  $ admin_district                 : chr "Islington"
##  $ parish                         : chr "Islington, unparished area"
##  $ admin_county                   : logi NA
##  $ admin_ward                     : chr "Bunhill"
##  $ ced                            : logi NA
##  $ ccg                            : chr "NHS North Central London"
##  $ nuts                           : chr "Haringey and Islington"
##  $ admin_district_code            : chr "E09000019"
##  $ admin_county_code              : chr "E99999999"
##  $ admin_ward_code                : chr "E05000367"
##  $ parish_code                    : chr "E43000209"
##  $ parliamentary_constituency_code: chr "E14000764"
##  $ ccg_code                       : chr "E38000240"
##  $ ccg_id_code                    : chr "93C"
##  $ ced_code                       : chr "E99999999"
##  $ nuts_code                      : chr "TLI43"
##  $ lsoa_code                      : chr "E01002704"
##  $ msoa_code                      : chr "E02000576"
##  $ lau2_code                      : chr "E09000019"

Check the vignette to see all functions in action.

Citation

Please cite this package if it is used in a publication

Walczak, E. (2021). PostcodesioR: API Wrapper Around 'Postcodes.io'. R package version 0.3.1, https://cran.r-project.org/web/packages/PostcodesioR/.

BibTeX entry is here:

@Manual{,
  title = {PostcodesioR: API Wrapper Around Postcodes.io},
  author = {Eryk Walczak},
  year = {2021},
  doi = {10.5281/zenodo.5717210},
  note = {R package version 0.3.1},
  url = {https://cran.r-project.org/web/packages/PostcodesioR/},
}

Notes

Currently, there is a limit to the number of API calls that can be made. However, postcodes.io provides full list of geolocation data that can be used locally without limitations. The original data is sourced from Office for National Statistics Data Portal. That file is rather large so I didn’t include it in the package.

Go to the package’s website or to my blog for more examples.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].