get_employment_within: Get Employment Within Boundary

Description Usage Arguments Value Examples

View source: R/get_employment_within.R

Description

Fetches the employment within a given boundary. The boundary is given as an sf file and intersected with LSOAs. The employment data is fetched from NOMIS Business Register and Employment Survey (BRES) data.

Usage

1
2
3
4
5
6
7
8
get_employment_within(
  boundary,
  year = "latest",
  type = "employment",
  split = FALSE,
  industry = "all",
  api_key = Sys.getenv("nomis_api_key")
)

Arguments

boundary

an sf polygon in England or Wales.

year

the year for which to return employment data

type

'employment' or 'employees'

split

If split is set to TRUE and type is set to 'employees', the employment will be separated into part time and full time workers

industry

'all' for no industry breakdown. 'broad' for broad sections, 'sections' for sections, or '2digit' for two digit SIC codes.

api_key

can be specified manually here, or set using 'set_nomis_api' function.

Value

a tibble containing employment data

Examples

1
2
3
4
5
iso <- make_isochrone(site = 'SE1 9SG', time = 30, method = 'mapbox', mode = 'driving')
emp <- get_employment_within(iso, 'latest', industry = 'all')
# total employment within isochrone:
emp %>%
 dplyr::summarise(total_emp = sum(employment_within))

Chrisjb/RDistanceMatrix documentation built on Jan. 27, 2021, 9:12 p.m.