getStratumNames: Extract or add stratum names from a SpatialPolygonsDataFrame

View source: R/Spatial.R

getStratumNamesR Documentation

Extract or add stratum names from a SpatialPolygonsDataFrame

Description

The stratum names must be stored as the column StratumName of the data of the SpatialPolygonsDataFrame stratum.

Usage

getStratumNames(
  stratum,
  StratumNameLabel = c("StratumName", "polygonName"),
  check.unique = TRUE,
  accept.wrong.name.if.only.one = FALSE
)

addStratumNames(
  stratum,
  StratumNameLabel = c("StratumName", "polygonName"),
  check.unique = TRUE,
  accept.wrong.name.if.only.one = FALSE
)

Arguments

stratum

A SpatialPolygonsDataFrame with a column StratumName of the data of the SpatialPolygonsDataFrame stratum.

StratumNameLabel

The name of the attribute representing the stratum names in the GeoJSON file or shapefile. When reading WKT or txt files the StratumNameLabel is ignored, as those formats does not support column names.

check.unique

Logical: If TRUE, an error is given if stratum names are not unique.

accept.wrong.name.if.only.one

Logical: If TRUE, interpret stratum names if only one column in the SpatialPolygonsDataFrame.


StoXProject/RstoxBase documentation built on Nov. 6, 2024, noon