R/arear.R
getContainedIn.Rd
This assumes an id column in input and output shapes and
- a sf containing points of interest (or shapes)
- a sf containing polygons to locate the input in
- defines the columns of the input that you want to retain (as a dplyr::vars(...) list). This grouping should uniquely identify the row. If not present will use the current grouping of inputShape.
- defines the columns of the output that you want to retain (as a dplyr::vars(...) list). This grouping should uniquely identify the row. If not present will use the current grouping of outputShape.
- the suffix of any duplicated columns as per dplyr::inner_join()
- a mapping as a dataframe relating the input id column and output id columns
# find the hospitals in a given area.
mapping = getContainedIn(
inputShape = arear::surgecapacity,
outputShape = arear::ukcovidmap(),
inputVars = dplyr::vars(hospitalId),
outputVars = dplyr::vars(code)
)
#> Spherical geometry (s2) switched off
#> caching item: ~/.cache/arear/reporting-map-87104ae5fea70bf68227e23cc93f9b65-72f531d1a36ddd6b5cbc433c29147817.rda
#> although coordinates are longitude/latitude, st_contains assumes that they are
#> planar