flagReport: Auto-generates a QAQC report website in html

Description Usage Arguments Details Examples

View source: R/flagReport.R

Description

Pulls data from internal NWIS server and runs automated data checks, generates tables, and produces an indexed notebook of flagged samples, tables, and plots for all sites entered.

Usage

1
2
3
flagReport(networkList, DSN, env.db = "01", qa.db = "02",
  begin.date = as.character(Sys.Date() - 365 * 10),
  end.date = as.character(Sys.Date()), outputDir)

Arguments

networkList

A dataframe containing network names in 1st column and station IDs in second column. Both columns must be of class character

DSN

A character string containing the DSN for your local server.

env.db

A character string containing the database number of environmental samples.

qa.db

A character string containing the database number of QA samples.

begin.date

Character string containing beginning date of data pull (yyyy-mm-dd). Default is 10 years from current date.

end.date

Character string containing ending date of data pull (yyyy-mm-dd). Default is current date.

outputDir

Directory to store output files. Must be an absolute path, e.g. "D:/flagReports"

Details

flagReport uses the readNWISodbc function to pull data for sites in networkList. Sites are grouped by the cooresponding network name in the first column of networkList. Reports for each site are generated and written to subfolders by network name. A top-level index is then generated to navigate between networks. Reports consist of automated data checks defined in https://internal.cida.usgs.gov/NAWQA/data_checks/docs/files/check30-sql.html and plots. Panels containing a timeseries, seasonal, parameter vs discharge and parameter vs SC plot are generated and indexed. This function can be used to auto-generate network QAQC reports overnight using R in batch mode with a script and Windows task scheduler.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
#This will not run if not connected to NWISCO server
networkList <- data.frame(network = c("BigThompson","BigThompson","Gunnison River"),
                          site = c("06733000","06741520","09109850"),
                          stringsAsFactors=FALSE)
flagReport(networkList = networkList,
          DSN = "NWISCO",
          env.db="01",
          qa.db="02",
          begin.date = as.character(Sys.Date()-365*10),
          end.date = as.character(Sys.Date()),
          outputDir = "C:/networkReportExample"
          )
          
## End(Not run)

USGS-R/WQ-Review documentation built on Nov. 12, 2019, 9:51 a.m.