Skip to contents

[Maturing]

tags regions in `source` by `target_id` of region in `target` with the largest overlap

Usage

tongfen_tag_largest_overlap(source, target, target_id)

Arguments

source

input geography

target

custom geography

target_id

name of the column in `target` table with unique id (character)

Value

`source` with extra column with the name given by `target_id` and column `...overlap_fraction` with the proportion of the area of the source region that overlaps with the region in `target` with that id

Examples

# Tag 2016 dissemination areas in the City of Vancouver by the 2006 census tract they overlap
# the most with
if (FALSE) { # \dontrun{
geo1 <- cancensus::get_census("CA06",regions=list(CSD="5915022"),geo_format='sf',level='CT')
geo2 <- cancensus::get_census("CA16",regions=list(CSD="5915022"),geo_format='sf',level='DA')
result <- tongfen_tag_largest_overlap(geo2,geo1 %>% select(CT_2006=GeoUID),"CT_2006")
} # }