Skip to content

Commit

Permalink
Getting rid of a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ldecicco-USGS committed Aug 3, 2017
1 parent 582dd77 commit 64f1a53
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions R/flexFNnew.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ estFNsegs <- function(eList, dateInfo){
#'
#' @param eList named list with at least the Daily, Sample, and INFO dataframes
#' @param years vector of years
#' @param waterYear logical. Should years be water years (\code{TRUE}) or calendar years (\code{FALSE})
#' @importFrom fields interp.surface
#' @importFrom dataRetrieval calcWaterYear
estFNyears <- function(eList, years, waterYear = TRUE){
Expand Down
4 changes: 3 additions & 1 deletion R/plotConcHist.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@
#' yearStart <- 2001
#' yearEnd <- 2010
#' eList <- Choptank_eList
#'
#' # Water year:
#' plotConcHist(eList, yearStart, yearEnd)
#' # Graphs consisting of Jun-Aug
#' eList <- setPA(eList, paStart=6,paLong=3)
#' plotConcHist(eList)
#'
#' \dontrun{
#' flowNormYears <- c(1985:2002,2006:2010)
#' plotConcHist(eList, flowNormYears=flowNormYears)
#' }
plotConcHist<-function(eList, yearStart = NA, yearEnd = NA,
flowNormYears = "all", waterYear = TRUE,
concMax = NA, printTitle = TRUE,
Expand Down
2 changes: 2 additions & 0 deletions R/plotFluxHist.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
#' # Graphs consisting of Jun-Aug
#' eList <- setPA(eList, paStart=6,paLong=3)
#' plotFluxHist(eList)
#' \dontrun{
#' # Flow normalized (excluding extremes from 2003-04):
#' yearVector <- c(1980:2002, 2005:2015)
#' plotFluxHist(eList, flowNormYears=yearVector)
#' }
plotFluxHist<-function(eList, yearStart = NA, yearEnd = NA, flowNormYears = "all",
waterYear = TRUE, fluxUnit = 9, fluxMax = NA, printTitle = TRUE,
plotFlowNorm = TRUE, tinyPlot=FALSE, col="black", col.pred="green",
Expand Down
2 changes: 2 additions & 0 deletions R/tableChange.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
#' @examples
#' eList <- Choptank_eList
#' # Water Year:
#' \dontrun{
#' tableChange(eList, fluxUnit=6, yearPoints=c(2001,2005,2008,2009))
#' tableChange(eList, fluxUnit=9)
#' tableChange(eList, fluxUnit=9, flowNormYear=c(2001:2006, 2008:2009))
#' # Winter:
#' eList <- setPA(eList, paStart=12,paLong=3)
#' tableChange(eList, fluxUnit=6,yearPoints=c(2001,2005,2008,2009))
#' }
tableChange<-function(eList, fluxUnit = 9, yearPoints = NA,
flowNormYears = "all", waterYear = TRUE) {

Expand Down
7 changes: 5 additions & 2 deletions R/tableChangeSingle.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@
#' @return dataframe with Year1, Year2, change[mg/L], slope[mg/L], change[percent], slope[percent] columns. The data in each row is the change or slope calculated from Year1 to Year2
#' @examples
#' eList <- Choptank_eList
#' \dontrun{
#' # Water Year:
#' #This returns concentration ASCII table in the console:
#' tableChangeSingle(eList, fluxUnit=6,yearPoints=c(2001,2005,2008,2009), flux=FALSE)
#' tableChangeSingle(eList, fluxUnit=6,yearPoints=c(2001,2005,2008,2009),
#' #Returns a data frame:
#' change <- tableChangeSingle(eList, fluxUnit=6,yearPoints=c(2001,2005,2008,2009),
#' flowNormYears=c(2003:2004, 2006:2009), flux=FALSE)
#' #This returns flux values ASCII table in the console
#' tableChangeSingle(eList, fluxUnit=6,yearPoints=c(2001,2005,2008,2009), flux=TRUE)
#' df <- tableChangeSingle(eList, fluxUnit=6,yearPoints=c(2001,2005,2008,2009), flux=TRUE)
#' # Winter:
#' eList <- setPA(eList, paStart=12,paLong=3)
#' tableChangeSingle(eList, fluxUnit=6,yearPoints=c(2001,2005,2008,2009), flux=FALSE)
#' }
tableChangeSingle<-function(eList, fluxUnit = 9, yearPoints = NA, flux = FALSE,
flowNormYears = "all", waterYear = TRUE) {

Expand Down
2 changes: 2 additions & 0 deletions R/tableResults.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#' @examples
#' eList <- Choptank_eList
#' # Water Year:
#' \dontrun{
#' tableResults(eList, fluxUnit = 1)
#' tableResults(eList, fluxUnit = 1, flowNormYears = c(1980:1995, 1997:2002, 2004:2011))
#' tableResults(eList, fluxUnit = 'kgDay', qUnit = 'cms')
#' returnedTable <- tableResults(eList, fluxUnit = 1)
#' # Winter:
#' eList <- setPA(eList, paLong=3,paStart=12)
#' tableResults(eList, fluxUnit = 1)
#' }
tableResults<-function(eList, qUnit = 2, fluxUnit = 9, flowNormYears = "all",
waterYear = TRUE) {

Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/tests_flow_normalization.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,10 @@ test_that("setupYears", {
expect_equal(tR$`FN Conc [mg/L]`[1], 1.003)
expect_equal(tR$`Flux [10^6kg/yr]`[1], 0.1154)
expect_equal(tR$`FN Flux [10^6kg/yr]`[1], 0.106)

tR_2 <- tableResults(eList, fluxUnit = 'kgDay', qUnit = 'cms')
expect_true(all(names(tR_2) %in% c("Year","Discharge [cms]",
"Conc [mg/L]","FN Conc [mg/L]",
"Flux [kg/day]","FN Flux [kg/day]")))

})

0 comments on commit 64f1a53

Please sign in to comment.