diff --git a/R/predConc.R b/R/predConc.R index 7f79fda..386167e 100644 --- a/R/predConc.R +++ b/R/predConc.R @@ -43,13 +43,17 @@ #' @export predConc <- function(fit, newdata, by="day", allow.incomplete=FALSE, conf.int=0.95) { - ## + ## By options and other preliminary code - if(is.null(fit$cfit)) + if(is.null(fit$cfit)) { stop("model cannot predict concentration values") - if(nrow(newdata) > 176000L) + } + + if(nrow(newdata) > 176000L) { stop("newdata has too many rows, the size limit is 176000") + } ByOpt <- c("unit", "day") + match.arg('by', ByOpt) Qadj <- fit$Qadj Tadj <- fit$Tadj flow <- fit$flow diff --git a/R/predLoad.R b/R/predLoad.R index 5512db1..d7b4090 100644 --- a/R/predLoad.R +++ b/R/predLoad.R @@ -64,9 +64,11 @@ predLoad <- function(fit, newdata, load.units=fit$load.units, by="total", ## 2014Sep23 DLLorenz Missing check on newdata ## ## By options and other preliminary code - if(nrow(newdata) > 176000L) + if(nrow(newdata) > 176000L) { stop("newdata has too many rows, the size limit is 176000") + } ByOpt <- c("unit", "day", "month", "water year", "calendar year", "total") + match.arg(by, ByOpt) load.units seopt <- match.arg(seopt, c("exact", "approximate")) Qadj <- fit$Qadj