Skip to contents

Parse grid square codes

Usage

parse_grid(x, grid_size = NULL, strict = TRUE)

Arguments

x

A character vector of grid square codes.

grid_size

A grid size.

strict

A scalar logical. Should the number of digits in the grid square code match a given number of digits? By default, TRUE.

Examples

parse_grid("53394526313")
#> Guessing, grid_size = "125m"
#> <grid_125m[1]>
#> [1] 53394526313
parse_grid("53394526313", "80km")
#> <grid_80km[1]>
#> [1] <NA>
parse_grid("53394526313", "80km",
           strict = FALSE)
#> <grid_80km[1]>
#> [1] 5339