Title: | Assists users in loading site data and preparing splitting volumes for the lab |
---|---|
Description: | Uses USGS NWISWeb web services to fetch data for the user's desired USGS NWIS stations; calculates sample bottle volumes for provided storm events; and returns this data in a text output file. |
Authors: | Laura Hubbard [aut], Jessica Thompson [aut], Laura DeCicco [cre] |
Maintainer: | Laura DeCicco <[email protected]> |
License: | CC0 |
Version: | 1.0.6 |
Built: | 2024-11-16 04:04:48 UTC |
Source: | https://github.com/USGS-R/SampleSplitting |
This function accepts an NWIS gage site id, an NWIS precip site id, a StartDate, an EndDate, a timezone and file names as needed
getADAPSData(siteNo, StartDt, EndDt, precipSite, dataFile = "", tzCode = "")
getADAPSData(siteNo, StartDt, EndDt, precipSite, dataFile = "", tzCode = "")
siteNo |
NWIS gaging station id |
StartDt |
a date to start data pulls |
EndDt |
a date to end data pulls |
precipSite |
NWIS precipitation station id |
dataFile |
string of data file path and name |
tzCode |
a timezone specification for the data |
adaps_data_all data frame containing merged ADAPS data for the requested site and date range
## Not run: siteNo <- "424421077495301" StartDt <- '2016-02-03' EndDt <- '2016-02-03' precipSite <- "424421077495301" tzCode <- "America/Jamaica" adaps_data_all <- getADAPSData(siteNo,StartDt,EndDt,precipSite,tzCode=tzCode) ## End(Not run)
## Not run: siteNo <- "424421077495301" StartDt <- '2016-02-03' EndDt <- '2016-02-03' precipSite <- "424421077495301" tzCode <- "America/Jamaica" adaps_data_all <- getADAPSData(siteNo,StartDt,EndDt,precipSite,tzCode=tzCode) ## End(Not run)
This function accepts a merged data frame of ADAPS data for a site/storm event
hydrographInteractive(adaps_data_all)
hydrographInteractive(adaps_data_all)
adaps_data_all |
data frame containing merged ADAPS data for the requested storm event |
hydrographInteractive html object containing code to create googleVis plot
rdbExample<-rdbExample hydrographInteractive(rdbExample)
rdbExample<-rdbExample hydrographInteractive(rdbExample)
This function accepts a merged data frame of ADAPS data for a site/storm event
hydrographPDF(adaps_data_all, siteNo, dateInt, tzCode = "America/Chicago")
hydrographPDF(adaps_data_all, siteNo, dateInt, tzCode = "America/Chicago")
adaps_data_all |
data frame containing merged ADAPS data for the requested storm event |
siteNo |
string containing USGS gage number |
dateInt |
number containing number of hours difference between x-axis tick marks |
tzCode |
character a timezone specification for the data #' @export |
This function accepts a siteNo, StartDt, EndDt and tableOut list of data for a given storm event
intermediateVolTable(siteNo, StartDt, EndDt, tableOut)
intermediateVolTable(siteNo, StartDt, EndDt, tableOut)
siteNo |
USGS station id |
StartDt |
start of storm event |
EndDt |
end of storm event |
tableOut |
list of data frames of event data |
This function accepts a data frame of data for a site/storm event, storm start dates, storm end dates, storm names, maximum volume in one sample bottle, and maximum volume for an entire storm sample
labDataOut( adaps_data_all, StormStart, StormEnd, StormName, maxBottleVol, maxSampVol, removeDate = NA, subNum = -9, tzCode = "America/Chicago" )
labDataOut( adaps_data_all, StormStart, StormEnd, StormName, maxBottleVol, maxSampVol, removeDate = NA, subNum = -9, tzCode = "America/Chicago" )
adaps_data_all |
data frame containing merged ADAPS data for the requested site and date range |
StormStart |
vector of datetimes for storm starts |
StormEnd |
vector of datetime for storm ends |
StormName |
vector of storm names |
maxBottleVol |
vector of maximum volumes in one subsample bottle |
maxSampVol |
vector of maximum volumes of one total sample |
removeDate |
vector of datetimes to be removed from the calculation, in the same timezone as adaps_data_all$datetime |
subNum |
vector of starting numbers for first bottle of each storm event |
tzCode |
character a timezone specification for the data |
tableOut list of a table for each storm event of bottle volumes
rdbExample <- rdbExample tzCode <- "America/Chicago" maxBottleVol <- c(400,600,600,600,600,600,600,400,600,800) maxSampVol <- c(3900,3900,3900,3900,3900,3900,3900,3900,3900,3900) StormStart <- c("2008-05-30 02:51","2008-06-05 04:39","2008-06-06 04:22", "2008-06-07 22:52","2008-06-08 08:41","2008-06-08 19:03", "2008-06-12 09:03","2008-06-12 21:40","2008-06-14 16:52", "2008-06-15 04:07") StormEnd <- c("2008-05-30 08:49","2008-06-05 07:21","2008-06-06 05:28", "2008-06-08 01:14","2008-06-08 11:39","2008-06-08 21:31", "2008-06-12 10:22","2008-06-13 01:36","2008-06-14 18:05", "2008-06-15 09:22") StormName <- c("S2-066","S2-067","S2-068","S2-069","S2-070","S2-071", "S2-072","S2-073","S2-074","S2-075") subNum <- c(1,1,1,1,16,1,1,5,1,7) dataOut <- labDataOut(rdbExample, StormStart,StormEnd, StormName,maxBottleVol,maxSampVol) removeDate <- as.POSIXct("2008-06-15 05:44:00") dataOut2 <- labDataOut(rdbExample, StormStart, StormEnd, StormName,maxBottleVol,maxSampVol, removeDate, tzCode = tzCode)
rdbExample <- rdbExample tzCode <- "America/Chicago" maxBottleVol <- c(400,600,600,600,600,600,600,400,600,800) maxSampVol <- c(3900,3900,3900,3900,3900,3900,3900,3900,3900,3900) StormStart <- c("2008-05-30 02:51","2008-06-05 04:39","2008-06-06 04:22", "2008-06-07 22:52","2008-06-08 08:41","2008-06-08 19:03", "2008-06-12 09:03","2008-06-12 21:40","2008-06-14 16:52", "2008-06-15 04:07") StormEnd <- c("2008-05-30 08:49","2008-06-05 07:21","2008-06-06 05:28", "2008-06-08 01:14","2008-06-08 11:39","2008-06-08 21:31", "2008-06-12 10:22","2008-06-13 01:36","2008-06-14 18:05", "2008-06-15 09:22") StormName <- c("S2-066","S2-067","S2-068","S2-069","S2-070","S2-071", "S2-072","S2-073","S2-074","S2-075") subNum <- c(1,1,1,1,16,1,1,5,1,7) dataOut <- labDataOut(rdbExample, StormStart,StormEnd, StormName,maxBottleVol,maxSampVol) removeDate <- as.POSIXct("2008-06-15 05:44:00") dataOut2 <- labDataOut(rdbExample, StormStart, StormEnd, StormName,maxBottleVol,maxSampVol, removeDate, tzCode = tzCode)
This function accepts a data frame of data for a site/storm event, storm start dates, storm end dates, storm names, maximum volume in one sample bottle, and maximum volume for an entire storm sample
labDataOutMI( adaps_data_all, StormStart, StormEnd, StormName, maxBottleVol, maxSampVol, removeDate = NA, subNum = -9 )
labDataOutMI( adaps_data_all, StormStart, StormEnd, StormName, maxBottleVol, maxSampVol, removeDate = NA, subNum = -9 )
adaps_data_all |
data frame containing merged ADAPS data for the requested site and date range |
StormStart |
vector of datetimes for storm starts |
StormEnd |
vector of datetime for storm ends |
StormName |
vector of storm names |
maxBottleVol |
vector of maximum volumes in one subsample bottle |
maxSampVol |
vector of maximum volumes of one total sample |
removeDate |
vector of datetimes to be removed from the calculation |
subNum |
vector of starting numbers for first bottle of each storm event |
tableOut list of a table for each storm event of bottle volumes
rdbExample <- rdbExample maxBottleVol <- c(400,600,600,600,600,600,600,400,600,800) maxSampVol <- c(3900,3900,3900,3900,3900,3900,3900,3900,3900,3900) StormStart <- c("2008-05-30 02:51","2008-06-05 04:39","2008-06-06 04:22", "2008-06-07 22:52","2008-06-08 08:41","2008-06-08 19:03", "2008-06-12 09:03","2008-06-12 21:40","2008-06-14 16:52", "2008-06-15 04:07") StormEnd <- c("2008-05-30 08:49","2008-06-05 07:21","2008-06-06 05:28", "2008-06-08 01:14","2008-06-08 11:39","2008-06-08 21:31", "2008-06-12 10:22","2008-06-13 01:36","2008-06-14 18:05", "2008-06-15 09:22") StormName <- c("S2-066","S2-067","S2-068","S2-069","S2-070","S2-071", "S2-072","S2-073","S2-074","S2-075") subNum <- c(1,1,1,1,16,1,1,5,1,7) labDataOut(rdbExample,StormStart,StormEnd,StormName, maxBottleVol,maxSampVol)
rdbExample <- rdbExample maxBottleVol <- c(400,600,600,600,600,600,600,400,600,800) maxSampVol <- c(3900,3900,3900,3900,3900,3900,3900,3900,3900,3900) StormStart <- c("2008-05-30 02:51","2008-06-05 04:39","2008-06-06 04:22", "2008-06-07 22:52","2008-06-08 08:41","2008-06-08 19:03", "2008-06-12 09:03","2008-06-12 21:40","2008-06-14 16:52", "2008-06-15 04:07") StormEnd <- c("2008-05-30 08:49","2008-06-05 07:21","2008-06-06 05:28", "2008-06-08 01:14","2008-06-08 11:39","2008-06-08 21:31", "2008-06-12 10:22","2008-06-13 01:36","2008-06-14 18:05", "2008-06-15 09:22") StormName <- c("S2-066","S2-067","S2-068","S2-069","S2-070","S2-071", "S2-072","S2-073","S2-074","S2-075") subNum <- c(1,1,1,1,16,1,1,5,1,7) labDataOut(rdbExample,StormStart,StormEnd,StormName, maxBottleVol,maxSampVol)
This function accepts a vector of storm names, vector of storm start and end datetimes and list of dataframes containing event data
labVolumesTable( StormName, StormStart, StormEnd, tableOut, bottlePickup, tzCode = "America/Chicago" )
labVolumesTable( StormName, StormStart, StormEnd, tableOut, bottlePickup, tzCode = "America/Chicago" )
StormName |
vector of storm name(s) |
StormStart |
vector of storm start dates |
StormEnd |
vector of storm end dates |
tableOut |
list of data frames containing event data |
bottlePickup |
dates bottles were retrieved |
tzCode |
character a timezone specification for the data |
This function accepts a vector of storm names, vector of storm start and end datetimes and list of dataframes containing event data
labVolumesTableMI(StormName, StormStart, StormEnd, tableOut, bottlePickup)
labVolumesTableMI(StormName, StormStart, StormEnd, tableOut, bottlePickup)
StormName |
vector of storm name(s) |
StormStart |
vector of storm start dates |
StormEnd |
vector of storm end dates |
tableOut |
list of data frames containing event data |
bottlePickup |
dates bottles were retrieved |
This function accepts a siteNo, StartDt and EndDt and merged data data frame for a storm event, and generates a data file
mergedDataTable(siteNo, StartDt, EndDt, adaps_data_all)
mergedDataTable(siteNo, StartDt, EndDt, adaps_data_all)
siteNo |
USGS station id |
StartDt |
start of storm event |
EndDt |
end of storm event |
adaps_data_all |
data frame of event data |
This function accepts an NWIS gage site id
paramAvailability(siteNo)
paramAvailability(siteNo)
siteNo |
NWIS gaging station id |
SiteFile data frame of data available for a given site from NWISWeb
## Not run: siteNo <- "441520088045002" StartDt <- '2014-03-10' EndDt <- '2014-03-17' paramAvailability(siteNo) ## End(Not run)
## Not run: siteNo <- "441520088045002" StartDt <- '2014-03-10' EndDt <- '2014-03-17' paramAvailability(siteNo) ## End(Not run)
This function accepts a vector of storm names, vector of storm start and end datetimes, vector of comments (optional) and list of dataframes containing event data
stormEventsTable( StormName, StormStart, StormEnd, tableOut, maxBottleVol, bottlePickup, removeComment = "", tzCode = "America/Chicago" )
stormEventsTable( StormName, StormStart, StormEnd, tableOut, maxBottleVol, bottlePickup, removeComment = "", tzCode = "America/Chicago" )
StormName |
vector of storm name(s) |
StormStart |
vector of storm start dates |
StormEnd |
vector of storm end dates |
tableOut |
list of data frames containing event data |
maxBottleVol |
maximum bottle volume |
bottlePickup |
date bottles were retrieved |
removeComment |
vector of comments |
tzCode |
character a timezone specification for the data |