Chapter 2 Interactive Graphing: Discharge of the Poudre River
“Someone asked me to name two structures that hold water. I was like, ‘well… damn!’”
This assignment used a unique package of R Markdown (dygraphs) in order to create an interactive chart.
Data and assignment provided by Dr. Matthew Ross and Dr. Nathan Mueller of Colorado State University.
2.1 Background on the Poudre River
Cache La Poudre River is an important watershed that supports agriculture, industry, recreation, and residential needs on the Front Range of Colorado. It also provides for cottonwood forest, shrub, and grassland ecosystems that support wildlife from the mountains down to the prairies. The unique biodiversity and history of the Cache La Poudre watershed are valued widely; 45 miles along the Poudre are encompassed in a National Heritage Area. The history of Cache La Poudre is linked to the history of the West, because its banks supported the first major irrigation-based agricultural settlement of its kind in 1870, which would soon spread through the Arid West.
2.2 Interactive Discharge Chart
<- readNWISdv(siteNumbers = '06752260',
q parameterCd = '00060',
startDate = '2017-01-01',
endDate = '2022-01-01') %>%
rename(q = 'X_00060_00003')
<- xts(q$q, order.by = q$Date)
q_xts
dygraph(q_xts) %>%
dyAxis("y", label = "Discharge (cfs)") %>%
dyOptions(drawPoints = TRUE, pointSize = 2)