── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(tmap)
Breaking News: tmap 3.x is retiring. Please test v4, e.g. with
remotes::install_github('r-tmap/tmap')
builtup_bounds <-st_read("OS Open Built Up Areas.gpkg",layer ="os_open_built_up_areas")
Reading layer `os_open_built_up_areas' from data source
`C:\Users\ts18jpf\OneDrive - University of Leeds\03_PhD\00_Misc_projects\Eng-Presc-Data\OS Open Built Up Areas.gpkg'
using driver `GPKG'
Simple feature collection with 8585 features and 7 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 65300 ymin: 10000 xmax: 655625 ymax: 1177650
Projected CRS: OSGB36 / British National Grid
Identifying the largest built-up areas within each region
all_BA_selected <-do.call( bind_rows,lapply(CCG_boundaries$code, \(t_code){ t_nhs <- CCG_boundaries[CCG_boundaries$code==t_code,] t_nhs_buffered <-st_buffer(t_nhs,dist =2e3) # Subsetting the biggest built-up NHS area builtup_bounds[t_nhs, ][t_nhs_buffered, op = st_within] |>slice_max(geometry_area_m) |>mutate(org_code = t_code) }))
A quick check of the largest built-up areas within each NHS region