extract_id.RdFor a specified polygon file, extract the three digit ID. It is expected that the polygon file has the name format "mh_030_polygon.shp". The function is vectorised it can be used for single or multiple values.
extract_id(filepath)
| filepath | a filepath or file name of a shapefile |
|---|
extract_id("mh_030_polygon.shp")#> [1] 30extract_id("polygons/mh_030_polygon.shp")#> [1] 30extract_id(c("polygons/mh_030_polygon.shp", "mh_031_polygon.shp"))#> [1] 30 31