Devoted to open data and open source in science and education.

View All Tutorials


LiDAR (7)
R programming (51)
Remote Sensing (12)
Data Visualization (4)
Hyperspectral Remote Sensing (7)
Hierarchical Data Formats (HDF5) (9)
Spatial Data & GIS (18)
Time Series (15)
Phenology (7)
Raster Data (8)
Vector Data (6)
Metadata (1)
Git & GitHub (6)
(1) (1)

Tutorial by R Package

dplyr (7)
ggplot2 (17)
h5py (1)
lubridate (time series) (6)
maps (1)
maptools (2)
plyr (2)
raster (26)
rasterVis (raster time series) (3)
rgdal (GIS) (22)
rgeos (3)
rhdf5 (11)
sp (5)
scales (4)
gridExtra (4)
ggtheme (0)
grid (2)
reshape2 (3)
plotly (5)

View ALL Tutorial Series

Twitter Youtube Github


R Bloggers



This activity will utilize the skills that you learned in the previous lessons. You will

  1. Import several rasters into R
  2. Perform raster math to calculate NDVI (Normalized Difference Vegetation Index)
  3. Create a color coded plot of NDVI
  4. Export the NDVI file as a georeferenced tiff.

What you'll need

  1. R or R studio loaded on your computer
  2. rgdal, raster, sp libraries installed on you computer.

Data to Download

Download the raster and insitu collected vegetation structure data:
Download NEON Teaching Data Subset: Field Site Spatial Data
These remote sensing data files provide information on the vegetation at the National Ecological Observatory Network's San Joaquin Experimental Range and Soaproot Saddle field sites. This data is intended for educational purposes, for access to all the data for research purposes visit the NEON Data Portal.

Recommended Reading

All of hte topics and concepts you need to complete this capstone were covered in the links on this page.

Generating a Raster of NDVI

The Normalized Difference Vegetation Index is calculated using the following equation: (NIR - Red) / (NIR + Red) where:

  1. NIR is the near infrared band in an image
  2. Red is the red band in an image.

Use the Red (Band 58 in the tiff files) and the NIR (band 90 in the tiff files) tiff files to

  1. Calculate NDVI in R.
  2. Plot NDVI. Make sure your plot has a title and a legend. Assign a colormap to the plot and specify the breaks for the colors to represent NDVI values that make sense to you. For instance, you might chose to color the data using breaks at .25,.5, .75 and 1.
  3. Expore your final NDVI dataset as a geotiff. Make sure the CRS is correct.
  4. To test your work, bring it into QGIS. Does it line up with the other tiffs (for example the band 19 tiff). Did it import properly?