as_gridref | R Documentation |
Converts a valid grid reference character string to a gridref object.
as_gridref(grid_reference = character())
grid_reference |
A Great British or Irish grid reference character string. |
Checks that the character string is a valid grid reference before converting to a gridref class. Returns an error if the grid reference is invalid.
A grid reference character string with an added gridref class.
Constructor function for gridref class as described in S3 chapter of Advanced R second additon by Hadley Wickham.
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))
# check grid_reference class
suppressPackageStartupMessages({
suppressWarnings({
library(purrr)
})
})
grid_references %>%
map_chr(., class)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.