Skip to contents

Appends columns with positions to a data table, based on an area code.

Coordinates are retrieved from a SpatialPolygonsDataFrame and not calculated the exact defintion of the coordinates depend on how the polygons were constructed.

Datum and projection is not enforced, but a warning is issued if 'areaPolygons' does not pass some checks to verify that it is not a planar projection.

Usage

appendPosition(
  table,
  areaPolygons,
  areaName,
  latColName,
  lonColName,
  StratumName = "StratumName"
)

Arguments

table

data.table to be annotated.

areaPolygons

SpatialPolygonsDataFrame

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.

Value

'table' with the positions appended in the columns 'latColName' and 'lonColName'.