Package 'DataKindR'

Title: Provides Helper Functions for DataKind Volunteers
Description: DataKind volunteers often need access to specific data or techniques in a DataDive or other project. This package seeks to simplify access to these resources.
Authors: Robin Penfold [aut, cre]
Maintainer: Robin Penfold <[email protected]>
License: MIT + file LICENSE
Version: 0.1.2
Built: 2024-10-31 18:37:09 UTC
Source: https://github.com/p0bs/DataKindR

Help Index


Clean UK postcodes and extract their relevant elements

Description

This function cleans UK postcode data before returning the relevant section (such as its first part of full postcode).

Usage

postcodes(postcode_value, postcode_type = "full")

Arguments

postcode_value

The postcode data to be cleaned (in the form of 'N1 1AA', 'ME1 2RE' or 'TN12 0QS').

postcode_type

The relevant section of the postcode to return. Only one section is permitted. Options are:

full

the full postcode (such as 'N1 1AA')

region

the first part of the first element of the postcode (such as 'ME' for 'ME1 2RE')

area

the first element of the postcode (such as 'ME1' for 'ME1 2RE')

locale

the area and the first part of the second element of the postcode (such as 'ME1 2' for 'ME1 2RE')

Examples

postcodes(
  postcode_value = 'ME1 2re ',
  postcode_type = 'region'
  )

Scrape geographic metadata about UK postcodes

Description

This function takes clean UK postcode data and returns key geographic metadata. Details include: LSOA, MSOA, Latitude, Longitude, Rank of Deprivation Index (out of 32,844 in total) and Constituency.

Usage

postcodes_metadata(postcode_value)

Arguments

postcode_value

The postcode data to be cleaned (in the form of 'N1 1AA', 'ME1 2RE' or 'TN12 0QS'). To clean this data, you could pass it through the 'postcodes' function in this package.

Examples

postcodes_metadata(
  postcode_value = "ME1 2RE"
  )