I have some polygon shapefiles (representing UK postcodes) which I have uploaded to BigQuery, using this guide, hoping to take advantage of the inbuilt GIS support described here.
I am trying to import these into R, and from there plot these in an R Shiny app (or use for other analysis).
Whilst I have managed to import the polygon data into R, using the "bigrquery" package, the data extracted is in an unfamiliar format to me - a table where the first column is a GeoJSON string for each shape (containing only the geography), and the other columns are attributes:
# A tibble: 5 x 4
geom POSTCODE UPP PC_AREA
<chr> <chr> <int> <chr>
1 "{\"type\":\"Polygon\",\"coordinates\":[[[-2.095015148797922,5… AB10 1AL 3 AB
2 "{\"type\":\"Polygon\",\"coordinates\":[[[-2.095031775835887,5… AB10 1AN 4 AB
3 "{\"type\":\"Polygon\",\"coordinates\":[[[-2.096682747887519,5… AB10 1AP 5 AB
4 "{\"type\":\"Polygon\",\"coordinates\":[[[-2.09786728657654,57… AB10 1AS 6 AB
5 "{\"type\":\"Polygon\",\"coordinates\":[[[-2.095637704208373,5… AB10 1AU 7 AB
I am trying to convert this within R to something more familiar e.g. an sf object or a SpatialPolygonsDataFrame, which will be easier to further manipulate/plot etc.
Is there a function I can use to do this?