Helpful WaterR Packages

Whether working with aquatic bioassessment data, delineating watersheds, or simply trying to make a map of some study sites, there are many packages in R that can assist you.

This is by no means a comprehensive list of packages, but it is a place to start for packages that can be useful for geospatial mapping, retrieving hydrologic data, or analysis.

Downloading Hydro Data

library(dataRetrieval) # great for retrieving USGS & NWIS water data
library(sharpshootR) # great for retrieving CDEC water data
library(nhdplusTools) # getting and working with NHD data
library(USAboundaries) # US boundaries 
library(elevatr) # elevation DEM data 
library(rnaturalearth) # global boundaries and associated spatial data
library(rnoaa) # NOAA climate data
library(rnrfa) # UK River data archive
library(spData) # spatial data examples
library(raster) # getData() pulls many raster datasets from elev, climate, admin

Geospatial Mapping

# GENERAL
library(sf) # the go-to spatial package in R, especially for vector data
library(units) # to rescale or convert your units


# INTERACTIVE
library(mapview) # interactive maps simplified
library(tmap) # either interactive OR static publication ready maps
library(leaflet) # interactive maps with more control, a bit more complex
library(mapedit) # allows interactive editing of maps and saving as sf objects
library(leafpm) # allows interactive editing of maps and saving as sf objects

# STATIC
library(ggplot2) # static publication-ready maps
library(ggspatial) # for plotting sf layers in ggplot, add compass, scale bar, etc
library(ggmap) # for adding Google base layers to ggplot map. **Requires registration**
library(ggthemes) # extra options in ggplot for color palettes and themes
library(ggrepel) # handy for adding labels to maps
library(rayshader) # 3D maps in R

# RASTER packages
library(raster) # the default package for all things raster
library(stars) # the "sf" version of raster

Wrangling & Analysis

library(tidyverse) # wrangling data
library(purrr) # helpful for applying functions over lists 
library(lubridate) # really useful for working with dates & times 

☵  Website design by Ryan Peek   Cal-SFS   ☵