View source: R/indivsInfo_AssignZones.R
indivsInfo_AssignZones | R Documentation |
Function to assign zones to individuals based on location(s).
indivsInfo_AssignZones( sf_dfr, sf_zones, geomNames = c("startGeom", "endGeom"), zoneNames = c("startZone", "endZone"), keepFirst = TRUE )
sf_dfr |
- sf dataframe with point geometries |
sf_zones |
- sf dataframe with zone information (polygons) |
geomNames |
- vector of names of geometry column(s) to use for assigning zone(s) |
zoneNames |
- vector of names of zones to be associated with each geomName |
keepFirst |
- flag to keep first zone in which a point geometry falls (see Details) |
Ideally, sf_zones
should consist of non-overlapping polygons so that
only one zone can be assigned to each geometry. If a point geometry is in an area of overlap
between multiple zones, a record would normally be included in the result for each zone
in which the point falls. If keepFirst
is TRUE, the record for the first zone
in which the point falls is kept. This is also the case if zones are assigned to multiple
geomNames
. Otherwise, records are added to the result for all zones in which a point falls.
sf_dfr
with additional column(s) indicating the zone(s) in which each geometry falls
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.