Lake Report
Scripts and report generator for Wisconsin Lake Reports.
lakeReport
projectworkflow-functions.R
scriptmakeReports
(see below)makeReports
Required Inputs for makeReports
function
Input | Type | Description |
---|---|---|
siteNumber |
string value or vector | the USGS station number OR auto |
wy |
numeric value | water year |
plotNames |
string value or vector | the name of the plot type you would like to produce [options: ghtable , stagehydrograph , qwtable , depthprofiles , qwtimeseries , auto ] |
output |
string value | the format you would like the file saved as [options: pdf or word ] |
Optional Inputs for makeReports
function with stagehydrograph
Input | Type | Description |
---|---|---|
filepath |
string value | indicates where your csv is located |
dateTime |
string value | indicates the column name in your csv where dates are stored |
gageHeight |
string value | indicates the column name in your csv where gage heights are stored |
More examples located in workflow-examples.R
.
# single site, single report
wy <- 2014
siteNumber <- '05390500'
plotNames <- 'ghtable'
output <- 'pdf'
makeReports(siteNumber, wy, plotNames, output)
# single site, multiple reports as word
wy <- 2014
siteNumber <- '455638089034501'
plotNames <- c('qwtable', 'depthprofiles', 'qwtimeseries')
output <- 'word'
makeReports(siteNumber, wy, plotNames, output)
# get all plotNames from `plotNames_by_site.csv` for a single site
wy <- 2014
siteNumber <- '05390500'
plotNames <- 'auto'
output <- 'word'
makeReports(siteNumber, wy, plotNames, output)
# run all possible site and plotName combinations from `plotNames_by_site.csv`
# currently makes all 89 combinations in ~ 6 minutes
wy <- 2014
siteNumber <- 'auto'
plotNames <- 'auto'
output <- 'word'
makeReports(siteNumber, wy, plotNames, output)
# use data from a file for stagehydrograph (not using dataRetrieval)
wy <- 2014
siteNumber <- '05390500'
plotNames <- 'stagehydrograph'
makeReports(siteNumber, wy, plotNames, 'pdf',
filePath = 'myfilepath',
dateTime = 'sample_dt',
gageHeight = 'result_va')
workflow-functions.R
, functions-[plotname].R
, and [plotname].Rmd
files.workflow-functions.R
and functions-[plotname].R
using the source button at the top right of your scripts window.wy
(numeric) and siteNumber
(character) objects. You should debug using only one site at a time.library()
calls in the first chunk of [plotname].Rmd
.[plotname].Rmd
file.browser()
on the line you would like to stop. Save the file and source it again. Be careful with placing browser()
inside if-else
structures, unless you truly want to only pause when it meets that specific condition.Next
, Continue
, and Stop
buttons in the Console
pane to navigate when in debug mode.[plotname].Rmd
, you will only need to save that file and rerun the lines of code.makeReports
and check that it looks as you would expect it to.New to this repo? Fork the master repository and setup remotes before trying to follow these directions.
git fetch upstream master
and then git merge upstream/master
to pull remote changes to your local repository.#
in the body of your PR. Then click "Create Pull Request".@
or assign the PR to them. Otherwise, click "Merge".install.packages(c("dataRetrieval","dplyr","lubridate","gsplot", "knitr"))
This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the official USGS copyright policy
Although this software program has been used by the U.S. Geological Survey (USGS), no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.
This software is provided "AS IS."