Monitoring the Hocking River

It is yet another rainy day but not really since the Hocking River that meanders through our town is under flood-watch. Things must be bad enough else why would the University cancel all classes for Monday. To whit: “A forecast for heavy rains and high winds have resulted in a flood warning for Athens County beginning this weekend into Monday. Based on current forecasts, specific areas on campus may be impacted by flooding Sunday evening into Monday morning. In addition to closed roadways and flooding on campus, there is a potential for high winds, which increases the possibility of widespread outages across campus, impacting power in residence halls, dining facilities and academic buildings.”

Naturally, being ever curious I decided to check out the dataRetrieval package and am glad I did because now I have another toy I can share with our Environmental Studies students. Here is a just quick plot of discharge levels over time.

library(dataRetrieval)
parameterCdFile <- parameterCdFile

siteNo <- "03159500"
pCode <- c("00060", "00065")
start.date <- "2008-01-01"
end.date <- "2018-04-06"

hocking <- readNWISuv(siteNumbers = siteNo,
                      parameterCd = pCode,
                      startDate = start.date,
                      endDate = end.date)

parameterInfo <- attr(hocking, "variableInfo")
siteInfo <- attr(hocking, "siteInfo")
hocking <- renameNWISColumns(hocking)
hocking$dates = as.Date(as.character(as.POSIXct(hocking$dateTime)))

library(tidyverse)
library(hrbrthemes)
ggplot(data = hocking, aes(dates, Flow_Inst)) +
  geom_line(color = "cornflowerblue") +
  scale_x_date(date_breaks = "4 years") +
  labs(y = "Discharge, cubic feet per second",
       x = "Date", title = "The Hocking River, Ohio",
       subtitle = "(1993 - 2018)",
       caption = "Source: USGS") +
  ylim(c(0, 20000)) +
  theme_ipsum_rc()

Historical gage height data are difficult to come by, or at least I had no luck finding it. As of the data of this revision – 2019-03-16 – the time-span seems to be restricted to the last few months. Consequently, I am going to grab and plot daily mean discharge data going back to 1913, and then the most recent gage data.

siteNo <- "03159500"
pCode <- "00060"
daily <- readNWISdv(siteNo, pCode)

ggplot(data = daily, aes(Date, X_00060_00003)) +
  geom_line(color = "cornflowerblue") +
  scale_x_date(date_breaks = "12 years") +
  labs(y = "Mean Discharge, cubic feet per second",
       x = "Date", title = "The Hocking River, Ohio",
       subtitle = "(1913 - 2018)",
       caption = "Source: USGS") +
  ylim(c(0, 20000)) +
  theme_ipsum_rc()

pCode <- "00065"
start.date <- "2018-09-22"
end.date <- "2019-01-20"

hocking <- readNWISuv(siteNumbers = siteNo,
                      parameterCd = pCode,
                      startDate = start.date,
                      endDate = end.date)

parameterInfo <- attr(hocking, "variableInfo")
siteInfo <- attr(hocking, "siteInfo")
hocking <- renameNWISColumns(hocking)
hocking$dates = as.Date(as.character(as.POSIXct(hocking$dateTime)))

ggplot(data = subset(hocking, !is.na(GH_Inst)),
       aes(dates, GH_Inst)) +
  geom_line(color = "firebrick") +
  scale_x_date(date_breaks = "3 weeks") +
  labs(y = "Gage Height (in feet)",
       x = "Date",
       title = "The Hocking River, Ohio",
       subtitle = "(Sep 22, 2018 - Jan 20, 2019)",
       caption = "Source: USGS") +
  theme_ipsum_rc()