| tetrad | R Documentation | 
This function returns the 2km grid reference for a higher precision grid reference.
tetrad(x)
## S3 method for class 'gridref'
tetrad(grid_reference)
grid_reference | 
 A Great British or Irish grid reference character string with class gridref.  | 
It can check either British or Irish grid references up to 10 figure (1m precision), including tetrads (2000m precision).
The grid reference at 2km resolution.
A REST API endpoint is available once a Plumber router has been created and can be requested by adding _api to the end of the function.
The API returns "" instead of NULL so that it may be used with the dplyr::mutate function. Wrap the API call with dplyr::na_if to convert "" to NA.
suppressPackageStartupMessages({
  suppressWarnings({
    library(plumber)
  })
})
pr("../R/gridref_api.R") %>%
  pr_run(port = 8000)
Other grid reference functions: 
easting(),
gridsquare_geometry(),
hectad(),
hectare(),
monad(),
northing(),
pentad(),
precision(),
projection(),
ten_metre()
 suppressPackageStartupMessages({
   suppressWarnings({
     library(dplyr)
     library(janitor)
   })
 })
 grid_references <- nbn_demonstration_dataset %>%
   clean_names() %>%
   slice_tail(n = 15) %>%
   select(grid_reference) %>%
   mutate(grid_reference = as_gridref(grid_reference))
# add two_km column
suppressPackageStartupMessages({
  suppressWarnings({
    library(dplyr)
  })
})
grid_references %>%
  rowwise() %>%
  mutate(two_km = tetrad(grid_reference))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.