05:00
Visualising spatial data in R
Get set up:
Slides: bit.ly/rss-making-maps
05:00
.shp
- The geometries i.e. the actual “shapes”.shx
- Index file.dbf
- Feature attributes i.e. population of a country..shp
file.geojson
.TAB
- Central file.DAT
- Attribute data.MAP
- Geographic information.ID
- Links geographic data to the database.TAB
fileADMIN | ISO_A3 | geometry |
---|---|---|
Aruba | ABW | MULTIPOLYGON (((-69.99694 1… |
Afghanistan | AFG | MULTIPOLYGON (((71.0498 38…. |
Angola | AGO | MULTIPOLYGON (((11.73752 -1… |
Anguilla | AIA | MULTIPOLYGON (((-63.03767 1… |
Albania | ALB | MULTIPOLYGON (((19.74777 42… |
Aland | ALA | MULTIPOLYGON (((20.92018 59… |
st_read
to load the ESRI data in data/ukgeom
plot()
07:00
tm_layout()
functiontm_layout()
functiontm_shape()
& tm_polygons()
to plot the UK datatm_polygons(col = "COL_NAME")
palette
argument in tm_polygons()
breaks
argumenttm_layout()
15:00
tmap_mode("plot")
ukgeom
, ukdata
.ukgeom
with ukdata
using left_join()
.15:00
Geocomputation with R book: r.geocompx.org
{sf} package: r-spatial.github.io/sf
#rspatial on social media
Our training courses
shiny-in-production.jumpingrivers.com