Monitoring the Hocking River

Its 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 that the University was forced to 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.

Updated on 2018-04-06 @ 8:52:32 EST Initially revised on 2018-02-25 @ 19:21:55 EST

library(dataRetrieval)

siteNo <- "03159500"
pCode <- c("00060", "00065")
start.date <- "2004-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(ggplot2)
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()

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 = "(2017 - 2018)", caption = "Source: USGS") + theme_ipsum_rc()