knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
by Jason Williams
The idtemp R package includes tools for interacting with continuous water temperature data in R. It was developed to help facilitate exploration and analysis of Idaho stream temperature data using R. The package currently includes a tool for plotting NorWeST data by site. Future functionality will include tools for comparing NorWeST data to Idaho temperature criteria, and tools for importing and comparing user-supplied temperature data to criteria.
This tutorial assumes users have some basic R experience, such as installing and loading R packages.
Package source code is available on github: https://github.com/jjwill2/idtemp
# devtools package is required to install packages from github library(devtools) #install idtemp package install_github("jjwill2/idtemp") # load idtemp package library(idtemp)
NorWeST data are included with the R package; when you load the package, you also load daily summary statistics and site information from the NorWeST database.
To plot data for a site, use the plot_norwest() function, which requires three arguments: a NorWeST basin name (Clearwater, Salmon, SpoKoot, MidSnake, or SnakeBear), a site (PERMA_FID), and parameter to plot (DailyMean, DailyMax, DailyMin, or DailySD). The resulting plot is faceted by year. Facet labels are OBSPRED_ID: Year, where OBSPRED_ID a unique identifier for a site/year combination in the NorWeST database.
# plot DailyMean idtemp::plot_norwest(Clearwater, 12163, DailyMean) # plot DailyMax idtemp::plot_norwest(Clearwater, 12163, DailyMax)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.