Montefiore Medical Center/ Albert Einstein College of Medicine
This script combines individual transplant center buffers into unified, organ-level catchment areas.
Earlier steps created buffers (either distance-based or 60-minute travel-time isochrones) around each transplant center.
Here, those individual polygons are merged into a single combined service area for each organ, distance, and year.
---title: "Unite buffers"format: html---This script combines individual transplant center buffers into unified, organ-level catchment areas.Earlier steps created buffers (either distance-based or 60-minute travel-time isochrones) around each transplant center. Here, those individual polygons are merged into a **single combined service area** for each organ, distance, and year.::: {.Rcode title="Source code"}The full R script is available at:- [`R/unite_buffers.R`](https://github.com/VagishHemmige/HOPE-CDC-analysis-2026/blob/master/R/unite_buffers.R)This R script file is itself reliant on the following helper files:- [`R/setup.R`](https://github.com/VagishHemmige/HOPE-CDC-analysis-2026/blob/master/R/setup.R)- [`R/functions.R`](https://github.com/VagishHemmige/HOPE-CDC-analysis-2026/blob/master/R/functions.R):::## Why “Unite” Buffers?When buffers are created around multiple centers, they often:- Overlap geographically - Cover adjacent regions - Share common areas If we simply summed tract populations within each individual buffer, overlapping areas would be **double-counted**.To prevent this, we:- Combine (union) all individual center buffers- Create a single, continuous polygon representing the **total catchment area**- Ensure that each geographic area is counted only once---## Objects CreatedFour parallel objects are constructed:- `Transplant_center_all_buffer_united`- `Transplant_centers_active_buffer_united`- `Transplant_centers_HIV_buffer_united`- `Transplant_centers_HOPE_buffer_united`Each object is indexed by:1. Organ 2. Distance 3. Year (when applicable)---## How the Union WorksFor each:- Organ- Distance- (And year, when relevant)The script:1. Takes the set of individual buffer polygons2. Applies `st_union(geometry)`3. Collapses them into one merged geometry4. Converts the result back into an `sf` objectThe resulting dataset contains a single row labeled:catchment_area = "All Centers"This label clarifies that the polygon represents the combined service area of all centers in that category.---## Structure of the ResultAfter processing, the structure is:- `Transplant_center_all_buffer_united[[organ]][[distance]]`- `Transplant_centers_active_buffer_united[[organ]][[distance]][[year]]`- `Transplant_centers_HIV_buffer_united[[organ]][[distance]][[year]]`- `Transplant_centers_HOPE_buffer_united[[organ]][[distance]][[year]]`Each object is a **single merged polygon** representing the total geographic coverage of that center group.---## Why This Step MattersUniting buffers allows accurate calculation of:- Total population within service areas- Total number of people living with HIV within reach- Changes in geographic access between years- Comparisons across center categories (Active vs HIV vs HOPE)Without uniting overlapping buffers, population totals would be inflated and geographic access overstated.---```{r, eval=FALSE}#Unite for total calculationsTransplant_center_all_buffer_united<-list()Transplant_centers_active_buffer_united<-list()Transplant_centers_HIV_buffer_united<-list()Transplant_centers_HOPE_buffer_united<-list()for (organ_loop in organ_list){ for (distance_loop in distance_list){ Transplant_center_all_buffer_united[[organ_loop]][[distance_loop]]<- Transplant_center_all_buffer[[organ_loop]][[distance_loop]]%>% reframe( catchment_area = "All Centers", geometry = st_union(geometry) )%>% st_as_sf() for (year_loop in year_list){ Transplant_centers_active_buffer_united[[organ_loop]][[distance_loop]][[year_loop]]<- Transplant_centers_active_buffer[[organ_loop]][[distance_loop]][[year_loop]]%>% reframe( catchment_area = "All Centers", geometry = st_union(geometry) )%>% st_as_sf() Transplant_centers_HIV_buffer_united[[organ_loop]][[distance_loop]][[year_loop]]<- Transplant_centers_HIV_buffer[[organ_loop]][[distance_loop]][[year_loop]]%>% reframe( catchment_area = "All Centers", geometry = st_union(geometry) )%>% st_as_sf() Transplant_centers_HOPE_buffer_united[[organ_loop]][[distance_loop]][[year_loop]]<- Transplant_centers_HOPE_buffer[[organ_loop]][[distance_loop]][[year_loop]]%>% reframe( catchment_area = "All Centers", geometry = st_union(geometry) )%>% st_as_sf() } }}```## Other portions of the analysis- [**Setup**](setup.qmd): Defines global paths, data sources, cohort inclusion criteria, and analysis-wide constants.- [**Functions**](functions.qmd): Reusable helper functions for cohort construction, matching, costing, and modeling.- [**Tables**](tables.qmd): Summary tables and regression outputs generated from the final models.- [**Figures**](figures.qmd):Visualizations of costs, risks, and model-based estimates.- [**About**](about.qmd): methods, assumptions, and disclosures