Introduction to Working with Raster Data in R
The tutorials in this series cover how to open, work with and plot raster-format spatial data in R. Additional topics include working with spatial metadata (extent and coordinate reference system), reprojecting spatial data and working with raster time series data.
Data used in this series cover NEON Harvard Forest and San Joaquin Experimental Range field sites and are in GeoTIFF and .csv formats.
After completing the series you will:
- Raster 00
- Understand what a raster dataset is and its fundamental attributes.
- Know how to explore raster attributes in
- Be able to import rasters into
- Be able to quickly plot a raster file in
- Understand the difference between single- and multi-band rasters.
- Raster 01
- Know how to plot a single band raster in R.
- Know how to layer a raster dataset on top of a hillshade to create an elegant basemap.
- Raster 02
- Be able to reproject a raster in R.
- Raster 03
- Be able to to perform a subtraction (difference) between two rasters using raster math.
- Know how to perform a more efficient subtraction (difference) between two
rasters using the raster
overlay()function in R.
- Raster 04
- Know how to identify a single vs. a multi-band raster file.
- Be able to import multi-band rasters into
- Be able to plot multi-band color image rasters in
- Understand what a
NoDatavalue is in a raster.
- Raster 05
- Understand the format of a time series raster dataset.
- Know how to work with time series rasters.
- Be able to efficiently import a set of rasters stored in a single directory.
- Be able to plot and explore time series raster data using the
- Raster 06
- Be able to assign custom names to bands in a RasterStack for prettier plotting.
- Understand advanced plotting of rasters using the
- Raster 07
- Be able to extract summary pixel values from a raster.
- Know how to save summary values to a .csv file.
- Be able to plot summary pixel values using
- Have experience comparing NDVI values between two different sites.
Things You’ll Need To Complete This Series
To complete the tutorial series you will need an updated version of
preferably, RStudio installed on your computer.
is a programming language that specializes in statistical computing. It is a
powerful tool for exploratory data analysis. To interact with
R, we strongly
an interactive development environment (IDE).
Install R Packages
You can chose to install packages with each lesson or you can download all
of the necessary
R Packages now.
More on Packages in R – Adapted from Software Carpentry.
Working with Raster Data in R Tutorial Series: This tutorial series is part of a
Data Carpentry workshop
on using spatio-temporal in R. Other related series include: intro to spatio-temporal data and data management, working with vector data in R, and working with tabular time series data in R.