Skip to content
Snippets Groups Projects
Commit f3c94a5f authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Added more WQP error handling.

parent c526d153
No related branches found
No related tags found
1 merge request!63More error handling, specifically WQP.
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#' site1 <- whatWQPsites(siteid="USGS-01594440") #' site1 <- whatWQPsites(siteid="USGS-01594440")
#' #'
#' type <- "Stream" #' type <- "Stream"
#' sites <- whatWQPsites(statecode="US:55",countycode="US:55:025",siteType=type) #' sites <- whatWQPsites(countycode="US:55:025",siteType=type)
#' } #' }
whatWQPsites <- function(...){ whatWQPsites <- function(...){
...@@ -123,7 +123,13 @@ whatWQPsites <- function(...){ ...@@ -123,7 +123,13 @@ whatWQPsites <- function(...){
return(retval) return(retval)
} else { } else {
return(NA) if(headerInfo['Total-Site-Count'] == "0"){
warning("No data returned")
}
for(i in grep("Warning",names(headerInfo))){
warning(headerInfo[i])
}
} }
} }
...@@ -99,6 +99,11 @@ because it allows for other agencies rather than the USGS. ...@@ -99,6 +99,11 @@ because it allows for other agencies rather than the USGS.
nameToUse <- "pH" nameToUse <- "pH"
pHData <- readWQPdata(siteid="USGS-04024315",characteristicName=nameToUse) pHData <- readWQPdata(siteid="USGS-04024315",characteristicName=nameToUse)
pHDataExpanded <- readWQPdata(bBox="-90.10,42.67,-88.64,43.35",characteristicName=nameToUse) pHDataExpanded <- readWQPdata(bBox="-90.10,42.67,-88.64,43.35",characteristicName=nameToUse)
pHDataExpanded2 <- readWQPdata(bBox=c(-90.10,42.67,-88.64,43.35),characteristicName=nameToUse)
startDate <- as.Date("2008-01-01")
nutrientPysical <- readWQPdata(statecode="US:55",siteType="Stream",
samplMedia="Water",startDateLo=startDate,
characteristicType=c("Nutrient","Physical))
} }
} }
\keyword{WQP} \keyword{WQP}
......
...@@ -61,7 +61,7 @@ Arguments to the function should be based on \url{www.waterqualitydata.us/webser ...@@ -61,7 +61,7 @@ Arguments to the function should be based on \url{www.waterqualitydata.us/webser
site1 <- whatWQPsites(siteid="USGS-01594440") site1 <- whatWQPsites(siteid="USGS-01594440")
type <- "Stream" type <- "Stream"
sites <- whatWQPsites(statecode="US:55",countycode="US:55:025",siteType=type) sites <- whatWQPsites(countycode="US:55:025",siteType=type)
} }
} }
\keyword{WQP} \keyword{WQP}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment