Geodata in R

library(terra)
terra 1.7.55
library(sf)
Linking to GEOS 3.12.0, GDAL 3.8.3, PROJ 9.3.1; sf_use_s2() is TRUE


We will use two main packages in this course for working with geodata. sf (simple features) is used for vector data and terra will handle raster data.

Both packages are relatively new and are successors: * sf replaces the deprecated package sp. * terra replaces the deprecated package raster.

You will probably find a lot of code examples online (e.g. on Stack Overflow) that uses these old packages. DO NOT USE sp OR raster ANYMORE!

Task: Geodata I/O
  • Organize yourself some geodata.

  • Install the terra and sf packages.

  • Try to load a raster and a vector dataset into R.

  • What attributes are stored along the actual geodata?

  • Visualize the data.

Task: Geodata R Convinience
  • Install the geodata package
  • Check out what it can do.