# A data.frame containing two Irish grid references
x <- data.frame(igr = c("A00", "N8000", "D12T"))
# Convert a data.frame of Irish grid references to an sf object in the
# Irish Grid coordinate reference system
st_igr_as_sf(x, "igr")
# Convert to an sf object in the WGS 84 coordinate reference system
st_igr_as_sf(x, "igr", crs = 4326)
# Include the Irish Grid coordinates and precision in the sf object
st_igr_as_sf(x, "igr", add_coords = TRUE, precision = "prec")
# Convert into polygon features rather than point features
st_igr_as_sf(x, "igr", polygons = TRUE)
Run the code above in your browser using DataLab