Skip to content
R for the Rest of Us Logo

Mapping with R

34 lessons

Basics of Using the raster Package (01_15)

This lesson is locked

Get access to all lessons in this course.

If the video is not playing correctly, you can watch it in a new window

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Learn More

At the beginning of this video I advised loading the tidyverse package after raster to reduce your chance of getting a headache. This is because both packages contain a function called select() and it’s very common to use that function when using tidyverse workflows. When loading the tidyverse the package emits a message informing you of functions with conflicting names, which include the syntax to explicitly call a function:

package_name::function_name()

Using this code will make your function choice explicit and is a more strict way to ensure the code you’re expecting to run is run. If you have any interest in developing R packages in the future then you’ll learn more about this kind of thing.

The land cover data file we use in this video is categorised into 14 land use types that come from the UMD Land Cover Classification. It’s very much an out-of-date land cover classification scheme so has little application outside of this example exercise. There’s not a universally accepted land cover classification scheme in existence, and this dataset is widely used in blogposts and so I think it’s useful to demonstrate how to work with RasterLayer objects.

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.