Leah Wasser

Leah Wasser has contributed to the materials listed below. Leah is the director of the Earth Analytics Education Initiative at Earth Lab and maintains this website.

Course Lessons

Course lessons are developed as a part of a course curriculum. They teach specific learning objectives associated with data and scientific programming. Leah Wasser has contributed to the following lessons:

Challenge Yourself

This lesson contains a series of challenges that require using tidyverse functions in R to process data.

Automate Workflows Using Loops in R

When you are programming, it can be easy to copy and paste code that works. However this approach is not efficient. Learn how to create for-loops to process multiple files in R.

Handle Missing Data in R


Use tidyverse group_by and summarise to Manipulate Data in R

Learn how to write pseudocode to plan our your approach to working with data. Then use tidyverse functions including group_by and summarise to implement your plan.

Get Started with Clean Coding in R


Submit a pull request on the GitHub website

Learn how to create and submit a pull request to another repo.

How to fork a repo in GitHub

Learn how to fork a repository using the GitHub website.

Introduction to undoing things in git

Learn how to undo changes in git after they have been added or committed.

First steps with git: clone, add, commit, push

Learn basic git commands, including clone, add, commit, and push.

An introduction version control

Learn what version control is, and how Git and GitHub are used in a typical version control workflow.

Maps in R: R Maps Tutorial Using Ggplot

You can use R as a GIS. Learn how to create a map in R using ggplot in this R maps tutorial.

Sentiment Analysis of Colorado Flood Tweets in R

Learn how to perform a basic sentiment analysis using the tidytext package in R.

Create Maps of Social Media Twitter Tweet Locations Over Time in R

This lesson provides an example of modularizing code in R.

Use Tidytext to Text Mine Social Media - Twitter Data Using the Twitter API from Rtweet in R

This lesson provides an example of modularizing code in R.

Text Mining Twitter Data With TidyText in R

Text mining is used to extract useful information from text - such as Tweets. Learn how to use the Tidytext package in R to analyze twitter data.

Twitter Data in R Using Rtweet: Analyze and Download Twitter Data

You can use the Twitter RESTful API to access data about Twitter users and tweets. Learn how to use rtweet to download and analyze twitter social media data in R.

Work With Twitter Social Media Data in R - An Introduction

This lesson will discuss some of the challenges associated with working with social media data in science. These challenges include working with non standard text, large volumes of data, API limitations, and geolocation issues.

Creating Interactive Spatial Maps in R Using Leaflet

This lesson covers the basics of creating an interactive map using the leaflet API in R. We will import data from the Colorado Information warehouse using the SODA RESTful API and then create an interactive map that can be published to an HTML formatted file using knitr and rmarkdown.

Programmatically Accessing Geospatial Data Using API's - Working with and Mapping JSON Data from the Colorado Information Warehouse in R

This lesson walks through the process of retrieving and manipulating surface water data housed in the Colorado Information Warehouse. These data are stored in JSON format with spatial x, y information that support mapping.

Understand Namespaces in R - What Package Does Your fromJSON() Function Come From?

This lesson covers namespaces in R and how we can tell R where to get a function from (what code to use) in R.

Programmatically Access Data Using an API in R - The Colorado Information Warehouse

This lesson covers accessing data via the Colorado Information Warehouse SODA API in R.

Introduction to the JSON data structure

This lesson covers the JSON data structure. JSON is a powerful text based format that supports hierarchical data structures. It is the core structure used to create geoJSON which is a spatial version of json that can be used to create maps. JSON is preferred for use over .csv files for data structures as it has been proven to be more efficient - particulary as data size becomes large.

Access Secure Data Connections Using the RCurl R Package.

This lesson reviews how to use functions within the RCurl package to access data on a secure (https) server in R.

An Example of Creating Modular Code in R - Efficient Scientific Programming

This lesson provides an example of modularizing code in R.

Introduction to APIs

In this module, you learn various ways to access, download and work with data programmatically. These methods include downloading text files directly from a website onto your computer and into R, reading in data stored in text format from a website, into a data.frame in R and finally, accessing subsets of particular data using REST API calls in R.

Use lapply in R Instead of For Loops to Process .csv files - Efficient Coding in R

Learn how to take code in a for loop and convert it to be used in an apply function. Make your R code more efficient and expressive programming.

If Statements, Functions, and For Loops

Learn how to combine if statements, functions and for loops to process sets of text files.

Create For Loops

Learn how to write a for loop to process a set of .csv format text files in R.

Working with Function Arguments

Learn how to work with function arguments in the R programming language..

Get to Know the Function Environment & Function Arguments in R

This lesson introduces the function environment and documenting functions in R. When you run a function intermediate variables are not stored in the global environment. This not only saves memory on your computer but also keeps our environment clean, reducing the risk of conflicting variables.

How to Write a Function in R - Automate Your Science

Learn how to write a function in the R programming language.

What Could be Improved In this R Code?

Write Efficient Scientific Code - the DRY (Don't Repeat Yourself) Principle

This lesson will cover the basic principles of using functions and why they are important.

Work with MODIS Remote Sensing Data in R.

In this lesson you will explore how to import and work with MODIS remote sensing data in raster geotiff format in R. You will cover importing many files using regular expressions and cleaning raster stack layer names for nice plotting.

Calculate and Plot Difference Normalized Burn Ratio (dNBR) from Landsat Remote Sensing Data in R

In this lesson you review how to calculate difference normalized burn ratio using pre and post fire NBR rasters in R. You finally will classify the dNBR raster.

Work with the Difference Normalized Burn Index - Using Spectral Remote Sensing to Understand the Impacts of Fire on the Landscape

In this lesson you review the normalized burn ratio (NBR) index which can be used to identify the area and severity of a fire. Specifically you will calculate NBR using Landsat 8 spectral remote sensing data in raster, .tif format.

How to Replace Raster Cell Values with Values from A Different Raster Data Set in R

Often data have missing or bad data values that you need to replace. Learn how to replace missing or bad data values in a raster, with values from another raster in the same pixel location using the cover function in R.

Get Landsat Remote Sensing Data From the Earth Explorer Website

In this lesson you will review how to find and download Landsat imagery from the USGS Earth Explorere website.

Clean Remote Sensing Data in R - Clouds, Shadows & Cloud Masks

In this lesson, you will learn how to deal with clouds when working with spectral remote sensing data. You will learn how to mask clouds from landsat and MODIS remote sensing data in R using the mask() function. You will also discuss issues associated with cloud cover - particular as they relate to a research topic.

How to Convert Day of Year to Year, Month, Day in R

Learn how to convert a day of year value to a normal date format in R.

Adjust plot extent in R.

In this lesson you will review how to adjust the extent of a spatial plot in R using the ext() or extent argument and the extent of another layer.

Plot Grid of Spatial Plots in R.

In this lesson you learn to use the par() or parameter settings in R to plot several raster RGB plots in R in a grid.

How to Remove Borders and Add Legends to Spatial Plots in R.

In this lesson you review how to remove those pesky borders from a raster plot using base plot in R. We also cover adding legends to your plot outside of the plot extent.

Add Variables to an RMD Report R.

How to Reuse Functions That You Create In Scripts - Source a Function in R

Learn how to source a function in R. Learn how to import functions that are stored in a separate file into a script or R Markdown file.

Landsat Remote Sensing tif Files in R

In this lesson you will cover the basics of using Landsat 7 and 8 in R. You will learn how to import Landsat data stored in .tif format - where each .tif file represents a single band rather than a stack of bands. Finally you will plot the data using various 3 band combinations including RGB and color-infrared.

The Fastest Way to Process Rasters in R


Calculate NDVI in R: Remote Sensing Vegetation Index

NDVI is calculated using near infrared and red wavelengths or types of light and is used to measure vegetation greenness or health. Learn how to calculate remote sensing NDVI using multispectral imagery in R.

How Multispectral Imagery is Drawn on Computers - Additive Color Models

In this lesson you will learn the basics of using Landsat 7 and 8 in R. You will learn how to import Landsat data stored in .tif format - where each .tif file represents a single band rather than a stack of bands. Finally you will plot the data using various 3 band combinations including RGB and color-infrared.

How to Open and Work with NAIP Multispectral Imagery in R

In this lesson you learn how to open up a multi-band raster layer or image stored in .tiff format in R. You are introduced to the stack() function in R which can be used to import more than one band into a stack object in R. You also review using plotRGB to plot a multi-band image using RGB, color-infrared to other band combinations.

Introduction to Spatial and Spectral Resolution: Multispectral Imagery

Multispectral imagery can be provided at different resolutions and may contain different bands or types of light. Learn about spectral vs spatial resolution as it relates to spectral data.

Import and Summarize Tree Height Data and Compare it to Lidar Derived Height in R

It is important to compare differences between tree height measurements made by humans on the ground to those estimated using lidar remote sensing data. Learn how to perform this analysis and calculate error or uncertainty in R.

Extract Raster Values Using Vector Boundaries in R

This lesson reviews how to extract pixels from a raster dataset using a vector boundary. You can use the extracted pixels to calculate mean and max tree height for a study area (in this case a field site where tree heights were measured on the ground. Finally you will compare tree heights derived from lidar data compared to tree height measured by humans on the ground.

Sources of Error in Lidar and Human Measured Estimates of Tree Height

There are difference sources of error when you measure tree height using Lidar. Learn about accuracy, precision and the sources of error associated with lidar remote sensing data.

GIS in R: Plot Spatial Data and Create Custom Legends in R

In this lesson you break down the steps required to create a custom legend for spatial data in R. You learn about creating unique symbols per category, customizing colors and placing your legend outside of the plot using the xpd argument combined with x,y placement and margin settings.

GIS in R: How to Reproject Vector Data in Different Coordinate Reference Systems (crs) in R

In this lesson you learn how to reproject a vector dataset using the spTransform() function in R.

GIS in R: Understand EPSG, WKT and other CRS definition styles

This lesson discusses ways that coordinate reference system data are stored including proj4, well known text (wkt) and EPSG codes.

GIS With R: Projected vs Geographic Coordinate Reference Systems

Geographic coordinate reference systems are often used to make maps of the world. Projected coordinate reference systems are use to optimize spatial analysis for a region. Learn about WGS84 and UTM Coordinate Reference Systems as used in R.

Coordinate Reference System and Spatial Projection

Coordinate reference systems are used to convert locations on the earth which is round, to a two dimensional (flat) map. Learn about the differences between coordinate reference systems.

GIS in R: shp, shx and dbf + prj - The Files That Make up a Shapefile

This lesson reviews the core files that are required to use a shapefile including: shp, shx and dbf. It also covers the .prj format which is used to define the coordinate reference system (CRS) of the data.

GIS in R: Intro to Vector Format Spatial Data - Points, Lines and Polygons

This lesson introduces what vector data are and how to open vector data stored in shapefile format in R.

Clip Raster in R

You can clip a raster to a polygon extent to save processing time and make image sizes smaller. Learn how to crop a raster dataset in R.

Classify a Raster in R.

This lesson presents how to classify a raster dataset and export it as a new raster in R.

Create a Canopy Height Model With Lidar Data

A canopy height model contains height values trees and can be used to understand landscape change over time. Learn how to use LIDAR elevation data to calculate canopy height and change in terrain over time.

How to Open and Use Files in Geotiff Format

A GeoTIFF is a standard file format with spatial metadata embedded as tags. Use the raster package in R to open geotiff files and spatial metadata programmatically.

Plot Histograms of Raster Values in R

This lesson introduces the raster geotiff file format - which is often used to store lidar raster data. You learn the 3 key spatial attributes of a raster dataset including Coordinate reference system, spatial extent and resolution.

Introduction to Lidar Raster Data Products

This lesson introduces the raster geotiff file format - which is often used to store lidar raster data. You learn the 3 key spatial attributes of a raster dataset including Coordinate reference system, spatial extent and resolution.

How Lidar Point Clouds Are Converted to Raster Data Formats - Remote Sensing

This lesson reviews how a lidar data point cloud is converted to a raster format such as a geotiff.

Introduction to Lidar Point Cloud Data - Active Remote Sensing

This lesson covers what a lidar point cloud is. We will use the free plas.io point cloud viewer to explore a point cloud.

What is Lidar Data

This lesson reviews what lidar remote sensing is, what the lidar instrument measures and discusses the core components of a lidar remote sensing system.

Layer a Raster Dataset Over a Hillshade Using R Baseplot to Create a Beautiful Basemap That Represents Topography

This lesson covers how to overlay raster data on a hillshade in R using baseplot and layer opacity arguments.

Add a Basemap to an R Markdown Report Using ggmap

This lesson covers creating a basemap with the ggmap package in R. Given some ongoing bugs with ggmap it also covers the map package as a backup!

Create Interactive Plots in R - Time Series & Scatterplots Using plotly and dygraphs

Learn how to create interactive reports using plotly and dygraphs in R for plotting.

Subset & Aggregate Time Series Precipitation Data in R Using mutate(), group_by() and summarise()

This lesson introduces the mutate() and group_by() dplyr functions - which allow you to aggregate or summarize time series data by a particular field - in this case you will aggregate data by day to get daily precipitation totals for Boulder during the 2013 floods.

Homework Challenge: Plot USGS Stream Discharge Data in R

This lesson illustrated what your final stream discharge homework plots should look like for the week. Use all of the skills that you've learned in the previous lessons to complete it.

Summarize Time Series Data by Month or Year Using Tidyverse Pipes in R

Learn how to summarize time series data by day, month or year with Tidyverse pipes in R.

Use Tidyverse Pipes to Subset Time Series Data in R

Learn how to extract and plot data by a range of dates using pipes in R.

Time Series Data: Work with Dates in R

Times series data can be manipulated efficiently in R. Learn how to work with, plot and subset data with dates in R.

Plot Data and Customize Plots with ggplot Plots in R - Earth Analytics - Data Science for Scientists

Learn how to plot data and customize your plots using ggplot in R.

How to Address Missing Values in R

Missing data in R can be caused by issues in data collection and / or processing and presents challenges in data analysis. Learn how to address missing data values in R.

How to Import, Work with and Plot Spreadsheet (Tabular) Data in R

Learn how to import and plot data in R using the read_csv & qplot / ggplot functions.

Understand the Vector Data Type in R and Classes Including Strings, Numbers and Logicals - Data Science for Scientists 101

This tutorial introduces vectors in R. It also introduces the differences between strings, numbers and logical or boolean values (True / False) in R.

Creating Variables in R and the String vs Numeric Data Type or Class - Data Science for Scientists 101

This lesson covers creating variables or objects in R. It also introduces some of the basic data types or classes including strings and numbers. This lesson is designed for someone who has not used R before.

The Syntax of the R Scientific Programming Language - Data Science for Scientists 101

This lesson introduces the basic syntax associated with the R scientific programming language. You will learn about assignment operators (<-), comments and basic functions that are available to use in R to perform basic tasks including head(), qplot() to quickly plot data and others. This lesson is designed for someone who has not used R before. You will work with precipitation and stream discharge data for Boulder County.

How to Download and Install QGIS

QGIS is a free, open-souce GIS tool that is comparable to ArcMap. This lesson walks through how to install QGIS on your computer.

Get Help with R - Data Science for Scientists 101

This tutorial covers ways to get help when you are not sure how to perform a task in R.

Write Clean Code - Expressive or Literate Programming in R - Data Science for Scientists 101

This lesson covers the basics of clean coding meaning that you ensure that the code that you write is easy for someone else to understand. The lesson will briefly cover style guides, consistent spacing, literate object naming best practices.

Explore Precipitation and Stream Flow Data Using Interactive Plots: The 2013 Colorado Floods

Practice interpreting data on plots that show rainfall (precipitation) and stream flow (discharge) as it changes over time.

Work With Precipitation Data in R: 2013 Colorado Floods

Learn why documentation is important when analyzing data by evaluating someone elses report on the Colorado floods.

Use Google Earth Time Series Images to Explore Flood Impacts

Learn how to use the time series feature in Google Earth to view before / after images of a location.

R Markdown resources

Find resources that will help you use the R Markdown format.

Add Citations and Cross References to an R Markdown Report with Bookdown

Learn how to use bookdown in R to add citations and cross references to your data-driven reports.

Add Images to an R Markdown Report

This lesson covers how to use markdown to add images to a report. It also discusses good file management practices associated with saving images within your project directory to avoid losing them if you have to go back and work on the report in the future.

Convert R Markdown to PDF or HTML

Knitr can be used to convert R Markdown files to different formats, including web friendly formats. Learn how to convert R Markdown to PDF or HTML in RStudio.

How to Use R Markdown Code Chunks

Code chunks in an R Markdown document are used to separate code from text in a Rmd file. Learn how to create reports using R Markdown.

Introduction to Markdown Syntax - a Primer

Learn how to write using the markdown syntax in an R Markdown document.

How to create an R Markdown File in R Studio and the R Markdown File Structure

Learn about the format of a R Markdown file including a YAML header, R code and markdown formatted text.

Introduction to R Markdown & Knitr - Connect Data, Methods and Results

Learn what open science is and how R Markdown can help you document your work.

Create a Project & Working Directory Setup

Learn how to create a well-organized working directory to store your course data.

File Organization 101

Learn key principles for naming and organizing files and folders in a working directory.

Install & Use Packages in R

Learn what a package is in R and how to install packages to work with your data.

Get to Know RStudio

Learn how to work with R using the RStudio application.

Install & Set Up R and RStudio on Your Computer

Learn how to download and install R and RStudio on your computer.

Data tutorials

Nothing to list here yet!