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

Added call to single pcode if it doesn't exist in file.

parent efa2e1aa
No related branches found
No related tags found
1 merge request!39Overhaul of function names. Move some functionality to EGRET.
......@@ -17,5 +17,19 @@ readNWISpCode <- function(parameterCd){
parameterData <- parameterCdFile[parameterCdFile$parameter_cd %in% parameterCd,]
if(nrow(parameterData) == 0){
if(length(parameterCd) == 1){
url <- paste0("http://nwis.waterdata.usgs.gov/nwis/pmcodes/pmcodes?radio_pm_search=pm_search",
"&pm_search=", parameterCd,
"&format=rdb", "&show=parameter_group_nm",
"&show=parameter_nm", "&show=casrn",
"&show=srsname", "&show=parameter_units")
parameterData <- importRDB1(url,asDateTime = FALSE)
}
#TODO: add else...
}
return(parameterData)
}
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