install.packages("devtools")
install.packages("remotes")
install.packages("ggplot2")
install.packages("cranlogs")
install.packages("sf")
install.packages("cowplot")
install.packages("remotes")
install.packages("lubridate")
install.packages("spData")
install.packages("spDataLarge", repos = "https://nowosad.r-universe.dev")
remotes::install_github("mhweber/Rspatialworkshop")
remotes::install_github("mhweber/awra2020spatial")
install.packages("rnaturalearth")
devtools::install_github("ropensci/rnaturalearthdata")
devtools::install_github("ropensci/rnaturalearthhires")
install.packages("osmdata")
install.packages("mapview")
install.packages("tigris")
install.packages("tidycensus")
install.packages("tmap")
install.packages("tmaptools")
remotes::install_github("mikejohnson51/AOI")
install.packages("ggspatial")
install.packages("dataRetrieval")
install.packages("stars")
install.packages("elevatr")
install.packages("nhdplusTools")
install.packages("terra")
install.packages("raster")
install.packages("tidyterra")
remotes::install_github("mikejohnson51/climateR")
remotes::install_github("USEPA/StreamCatTools", build_vignettes=FALSE)
remotes::install_github("mikejohnson51/opendap.catalog")
remotes::install_github("mikejohnson51/zonal")PNW Tribal Coding Retreat
Welcome
This site provides material presented at the PNW Tribal Coding Retreat in March 2025. Slides that accompany this workshop are available for download linked here by clicking the “Download raw file” button via the ellipsis or downward arrow symbol on the right side of the screen.
Material here is borrowed from a half-day workshop presented to the EPA R User Group meeting in 2023 - the particular sections we’ll focus on are:
- A walk through of some of the material in Foundations
- Quick discussion of some geoprocessing ideas
- Focus on some mapping approaches
- A look at several tools for using web services for hydrologic spatial analysis
Introduction
Marc Weber is a geographer at the Pacific Ecological Systems Division (PESD) at the United States Environmental Protection Agency (USEPA). His work supports various aspects of the USEPA’s National Aquatic Resource Surveys (NARS), which characterize the condition of waters across the United States, and he was one of the developers of and maintains the StreamCat and LakeCat datasets. His work focuses on spatial analysis in R and Python, Geographic Information Science (GIS), aquatic ecology, remote sensing, open source science and environmental modeling.
Set Up
The packages that we use throughout this workshop are listed below. To install them run:
How to follow along with material
This workshop was built using Quarto and rendered to html. If you are familiar with using git and GitHub, you can fork and clone this repository, or simply clone directly and open the corresponding .qmd files to follow along with material in RStudio. You can also copy code snippets from the rendered book site and paste into your code files in RStudio.
Quarto is a multi-language, next generation version of R Markdown from RStudio, with many new features and capabilities. Like R Markdown, Quarto uses Knitr to execute R code, and it can render most existing Rmd files without modification. Like R Markdown the benefits include:
- Allows for reproducible reporting from R
- You write your document in markdown and embed executable code chunks using the knitr syntax
- You can update your document at any time by re-knitting the code chunks and convert your document to a number of formats (i.e. html, pdf, word documents)
- We assume everyone in the workshop is familiar with using RStudio
You may click on any of the functions in this book to be directed to their respective documentation. For example, clicking on st_join() takes you to the documentation page for the st_join() function on the sf website.
Disclaimer
The views expressed in this manuscript are those of the authors and do not necessarily represent the views or policies of the U.S. Environmental Protection Agency. Any mention of trade names, products, or services does not imply an endorsement by the U.S. government or the U.S. Environmental Protection Agency. The U.S. Environmental Protection Agency does not endorse any commercial products, services, or enterprises.