Learn R Programming

rnbn (version 1.1.2)

gridRef: Manipulate OSGB or OSNI grid reference string

Description

Extracts grid reference strings at various precisions from the supplied grid reference string - if possible! For example, if you supply a 1km square reference TL2998, then you could get the 10km square TL29, but not a 100m square grid reference.

Usage

gridRef(grid = NULL, format = c("sq10km", "sq5km", "tetrad", "sq1km", "sq100m", "sq10m"))

Arguments

grid
the grid reference to be manipulated
format
the format you want back. The possibilities are: sq10km, sq5km, tetrad, sq1km, sq100m, sq10m

Value

a list of class "gridref" with the following contents: a list of class "gridref" with the following contents:

See Also

gridCoords

Examples

Run this code
gridRef("TL2998", "sq10km") # Returns TL29
gridRef("TL29", "sq1km") # Returns NULL - you cannot get a 1km from a 10km!

Run the code above in your browser using DataLab