Description Usage Arguments Value Examples
View source: R/get_population_within.R
Fetches the population within a given boundary. The boundary is given as an sf file and intersected with LSOAs. The population data is fetched from NOMIS population estimates for small areas.
1 2 3 4 5 6 | get_population_within(
boundary,
year = "latest",
age = "all",
api_key = Sys.getenv("nomis_api_key")
)
|
boundary |
an sf polygon in England or Wales. |
year |
the year for which to return employment data |
age |
'all' for no age breakdown. 'working' returns young, working age, and older groupings. 'five_year' for five year groupings or 'sya' for single year of age. |
api_key |
can be specified manually here, or set using 'set_nomis_api' function. |
a tibble containing employment data
1 2 3 4 5 | iso <- make_isochrone(site = 'SE1 9SG', time = 30, method = 'mapbox', mode = 'driving')
pop <- get_population_within(iso, 'latest', age = 'all')
# total employment within isochrone:
pop %>%
dplyr::summarise(total_pop = sum(population_within))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.