Skip to content

Commit

Permalink
Fixes #119.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldecicco-USGS committed Apr 27, 2015
1 parent e2f3b91 commit 2511ae8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/readWQPdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ readWQPdata <- function(...){
}

values <- gsub(",","%2C",values)
values <- gsub(";","%3B",values)
values <- gsub("%20","+",values)
values <- gsub(":","%3A",values)

Expand Down
16 changes: 16 additions & 0 deletions R/whatWQPsites.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,23 @@ whatWQPsites <- function(...){
values <- values[!(names(values) %in% "tz")]
}

if("statecode" %in% names(values)){
stCd <- values["statecode"]
if(!grepl("US:",stCd)){
values["statecode"] <- paste0("US:",stateCdLookup(stCd, "id"))
}
}

if("stateCd" %in% names(values)){
stCd <- values["stateCd"]
if(!grepl("US:",stCd)){
values["stateCd"] <- paste0("US:",stateCdLookup(stCd, "id"))
}
names(values)[names(values) == "stateCd"] <- "statecode"
}

values <- gsub(",","%2C",values)
values <- gsub(";","%3B",values)
values <- gsub("%20","+",values)
values <- gsub(":","%3A",values)

Expand Down

0 comments on commit 2511ae8

Please sign in to comment.