NEON @ ESA: Work With Spatial Raster Data & Time Series in R

August 07, 2016
Ecological Society of America Annual Meeting

This workshop will focus on working with spatial time series data, raster GeoTIFF format, in R. The working dataset is derived from remote sensing data. Participants will learn how to efficiently explore raster metadata and address projection-related issues, how to automate processing a raster time series, and how work with raster stacks in support of both RGB and time series data. The outcome goal of this workshop is a plot of NDVI over time derived from a raster time series that can be used to compare plant phenology at multiple sites. We will focus on the rasterand rgdal packages in R. rasterVis will be used to create raster time series plots.

All materials taught in this workshop were developed in collaborative effort between Data Carpentry and the National Ecological Observatory Network (NEON).

Required Prior Knowledge

The workshop will assume that participants have a basic level of familiarity with working with data in R, including installing and loading packages, and data import.


This 5-hr workshop will be taught at the 2016 meeting of the Ecological Society of America (ESA) in Ft. Lauderdale, FL. You must be a registered attendee of the conference and register for this workshop to participate in this workshop. For more information, visit the ESA 2016 annual meeting website.

Things You’ll Need For The Workshop

To participant in this workshop, you will need a laptop with the most current version of R and, preferably, RStudio loaded on your computer.

For details on setting up R & RStudio in Mac, PC, or Linux operating systems please see Additional Set up Resources below

Install R Packages

Please have these packages installed and updated prior to the start of the workshop.

  • raster: install.packages("raster")
  • rgdal: install.packages("rgdal")
  • rasterVis: install.packages("rasterVis")
  • ggplot2: install.packages("ggplot2")
Updating R Packages

In RStudio, you can go to Tools --> Check for package updates to update previously installed packages on your computer.

Or you can use update.packages() to update all packages that are installed in R automatically.

More on Packages in R

Download Data

Download NEON Teaching Data Subset: Airborne Remote Sensing Data

The LiDAR and imagery data used to create this raster teaching data subset were collected over the National Ecological Observatory Network's Harvard Forest and San Joaquin Experimental Range field sites and processed at NEON headquarters. The entire dataset can be accessed by request from the NEON Data Portal.

Download NEON Teaching Data Subset: Landsat-derived NDVI raster files

The imagery data used to create this raster teaching data subset were collected over the National Ecological Observatory Network's Harvard Forest and San Joaquin Experimental Range field sites.
The imagery was created by the U.S. Geological Survey (USGS) using a multispectral scanner on a Landsat Satellite. The data files are Geographic Tagged Image-File Format (GeoTIFF).

Once you have downloaded the data, please set up a "data" directory as a parent directory to these three uncompressed directories. Set your R working directory to this "data" directory prior to the beginning of the workshop. If you would like further instruction please see the bottom of this page.

Workshop Instructors

  • Megan A. Jones; @meganahjones, Staff Scientist/Science Educator; NEON program, Battelle
  • Mike Patterson; Science Technician & Geospatial Analyst; NEON program, Battelle
  • Tristan Goulden; Associate Scientist, Airborne Platform; NEON program, Battelle

Please get in touch with the instructors prior to the workshop with any questions.

Social Media?

Please tweet @NEON_sci or using the hashtag #WorkWithData during this workshop!

Workshop Time/Location

Location: Ft Lauderdale Convention Center, Rm 317 Please double check the conference schedule as rooms may change!

All online materials can be accessed and used after the workshop and are linked on the next page: Workshop Materials in menu bar.


Additional Set Up Instructions

Prior to the workshop you should have R and, preferably, RStudio installed on your computer.

Setting Up R & RStudio

Windows R/RStudio Setup

Once R and RStudio are installed, click to open RStudio. If you don't get any error messages you are set. If there is an error message, you will need to re-install the program.

Mac R/RStudio Setup

  • If your Mac is set up for UiO use, you can install R from Managed Software Center

  • Go to CRAN and click on Download R for (Mac) OS X

  • Select the .pkg file for the version of OS X that you have and the file will download.
  • Double click on the file that was downloaded and R will install
  • Go to the RStudio Download page
  • Under Installers select RStudio 0.98.1103 - Mac OS X 10.6+ (64-bit) to download it.
  • Once it's downloaded, double click the file to install it

Once R and RStudio are installed, click to open RStudio. If you don't get any error messages you are set. If there is an error message, you will need to re-install the program.

Linux R/RStudio Setup

  • R is available through most Linux package managers. You can download the binary files for your distribution from CRAN. Or you can use your package manager (e.g. for Debian/Ubuntu run sudo apt-get install r-base and for Fedora run sudo yum install R).
  • To install RStudi, go to the RStudio Download page
  • Under Installers select the version for your distribution.
  • Once it's downloaded, double click the file to install it

Once R and RStudio are installed, click to open RStudio. If you don't get any error messages you are set. If there is an error message, you will need to re-install the program.

<

h2 id="set-wd">Set Working Directory to Downloaded Data

1) Download Data

After clicking on the Download Data button, the data will automatically download to the computer.

2) Locate .zip file

Second, find the downloaded .zip file. Many browsers save downloaded files to your computer’s Downloads directory. If you have previously specified a specific directory (folder) for downloaded files, the .zip file will download there.

3) Move to **data** directory

Third, move the downloaded file to a directory called data within the Documents directory on your computer. You can choose to place the data in other locations, however, you will need to remember to set your R Working Directory to that location and not as we demonstrate in the workshop.

4) Unzip/uncompress

Fourth, we need to unzip/uncompress the file so that the data files can be accessed. Use your favorite tool that can unpackage/open .zip files (e.g., winzip, Archive Utility, etc). The files will now be accessible in three directories:

These directories contain all of the subdirectories and files that we will use in this workshop.

5) Set working directory

Fifth, we need to set the working directory in R to this data directory that is parent to the directories containing the data we want. For complete directions, on how to do that check out the Set A Working Directory in R tutorial.

Time Topic
11:45 Please come early if you have any setup or installation issues.
12:00 Introduction to Working With Raster Data in R
When Raster's Don't Line Up: Coordinate Reference System & Reprojection
13:30 --------- BREAK 1 ---------
13:45 NEON Remote Sensing Data Products Overview
14:15 Raster Time Series Data in R: Tutorials 05–07
15:00 --------- BREAK 2 ---------
15:15 Raster Time Series Data in R, continued
16:30 Final Questions & Evaluation
16:45 END with enough time to get to the ESA Opening Plenary

Tutorial: Raster 00: Intro to Raster Data in R

You can choose to do this optional data activity (opens in a new window), or continue to the next lesson plan.

Tutorial: Raster 02: When Rasters Don't Line Up - Reproject Raster Data in R

You can choose to do this optional data activity (opens in a new window), or continue to the next lesson plan.

Series: Working With Raster Time Series Data in R

You can choose to do this optional data activity (opens in a new window), or continue to the next lesson plan.

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Find more workshops
Workshop Overview
Workshop Materials
Dialog content.