Appends columns with positions to a data table, based on an area code.
Positions are centroids of areas. For oddly shaped (concave) areas, this can have unintended effects. The centroid may for instance lie outside the area.
Usage
appendPosition(
table,
areaPolygons,
areaName,
latColName,
lonColName,
StratumName = "StratumName"
)
Arguments
- table
data.table to be annotated.
- areaPolygons
sf
data.frames with area names identified in the column 'StratumName'- areaName
name of column that identifies the area in 'table'
- latColName
name of the latitdue column to be appended to 'table'
- lonColName
name of the longitude column to be appended to 'table'
- StratumName
name of the column in 'areaPolygons' that identifies the area.