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

added some na logic.

parent 67345acd
No related branches found
No related tags found
1 merge request!39Overhaul of function names. Move some functionality to EGRET.
......@@ -44,16 +44,18 @@ constructNWISURL <- function(siteNumber,parameterCd="00060",startDate="",endDate
service <- match.arg(service, c("dv","uv","iv","qw","gwlevels","rating","peak","meas"))
pcodeCheck <- all(nchar(parameterCd) == 5) & all(!is.na(suppressWarnings(as.numeric(parameterCd))))
if(!pcodeCheck){
badIndex <- which(parameterCd %in% parameterCdFile$parameter_cd)
if(length(badIndex) > 0){
badPcode <- parameterCd[-badIndex]
} else {
badPcode <- parameterCd
if(!is.na(parameterCd)){
pcodeCheck <- all(nchar(parameterCd) == 5) & all(!is.na(suppressWarnings(as.numeric(parameterCd))))
if(!pcodeCheck){
badIndex <- which(parameterCd %in% parameterCdFile$parameter_cd)
if(length(badIndex) > 0){
badPcode <- parameterCd[-badIndex]
} else {
badPcode <- parameterCd
}
message("The following pCodes may be unavailable:",paste(badPcode,collapse=","))
}
message("The following pCodes may be unavailable:",paste(badPcode,collapse=","))
}
multipleSites <- length(siteNumber) > 1
......
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