This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dataRetrieval) | |
library(EGRET) | |
siteID <- "01491000" #Choptank River at Greensboro, MD | |
startDate <- "1979-10-01" | |
endDate <- "2011-09-30" | |
param<-"00631" | |
Daily <- getDVData(siteID,"00060",startDate,endDate) | |
INFO<- getMetaData(siteID,param,interactive=FALSE) | |
INFO$shortName <- "Choptank River" | |
INFO <- setPA() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(USAboundaries) # contains data (shape files) | |
library(dplyr) # for wrangling | |
library(lubridate) # for wrangling dates | |
library(rgdal) # for wrangling shape files / map data | |
library(maptools) # for wrangling shape files / map data | |
library(ggplot2) # for plotting | |
library(gganimate) # for gif animation | |
library(viridis) # for lovely color palettes | |
library(dataRetrieval) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
county.data.url <- "http://nwis.usgs.gov/awuds/nwisweb/wu_countydata" | |
state.data.url <- "http://nwis.usgs.gov/awuds/nwisweb/wu_statedata" | |
library(readr) | |
county.data <- read_delim(county.data.url, delim = "\t") | |
long.county <- gather(county.data, variable, value, | |
-STUDY, -USSTATEALPHACODE, -STATECODE, -COUNTYCODE, | |
-STATECOUNTYCODE, -COUNTYNAME, -YEAR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(httr) | |
library(leaflet) | |
library(jsonlite) | |
# mapRange <- c(-86.32679,-81.16322,39.61600,43.06262) | |
# mapRange <- c(-89.560547,-97.163086, 39.731482, 43.793898) | |
mapRange <- c(-91.424186, -94.294625, 41.015733, 43.102420) | |
streamorder <- 6 | |
filePath=NA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(maps) | |
library(ggplot2) | |
library(dplyr) | |
library(rgdal) | |
library(geoknife) | |
library(tidyr) | |
library(dataRetrieval) | |
library(httr) | |
library(gganimate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dataRetrieval) | |
library(ggplot2) | |
library(dplyr) | |
sites <- c("402411077374801", | |
"364818094185302", | |
"405215084335400", | |
"370812080261901", | |
"393851077343001", | |
"444302070252401", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(grid) | |
library(gridExtra) | |
add_centered_title <- function(p, text, font_size){ | |
title.grob <- textGrob( | |
label = text, | |
gp = gpar(fontsize = font_size) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# x = data.frame with dec_long_va, dec_lat_va, state_abb, and scale columns | |
# dec_long_va = decimal longitude | |
# dec_lat_va = decimal latitude | |
# state_abb = 2 letter US state abbrieviation | |
# scale = a numeric column you are scaling by.... | |
library(dplyr) | |
library(ggplot2) | |
# x = data.frame with dec_long_va, dec_lat_va, state_abb, and scale columns | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dataRetrieval) | |
site <- "08279500" | |
discharge <- readNWISdv(site, "00060") | |
discharge <- renameNWISColumns(discharge) | |
site_info <- attr(discharge, "siteInfo") | |
param_info <- attr(discharge, "variableInfo") | |
station <- tolower(site_info$station_nm) | |
station <- tools::toTitleCase(station) |