Closed deleteblue closed 4 years ago
I think you probably have the site numbers formatted wrong. If it's a csv that looks like this:
Sites,
04024430,
04024000,
05114000
Then, to get a vector of site ids, you'd want to do:
siteno <- read.csv(path,
colClasses = "character",
stringsAsFactors = FALSE)[["Sites"]]
siteno
[1] "04024430" "04024000" "05114000"
q <- readNWISuv( siteNumbers = siteno, "00060", "2015-10-10", "2015-10-11")
If your sites are like this:
04024430,04024000,05114000
Then the call to get the site vector would be:
siteno <- as.character(read.csv("test.csv", header = FALSE,
colClasses = "character",
stringsAsFactors = FALSE)[1,])
If you want to paste a bit of your csv, I might be able to help more if the above doesn't solve it.
Yes! That was the problem! And now it is solved! Thank you!
I have a list of site numbers and I want to use readNWISuv. But I does not recognize it. How can I fix this issue?
siteno <- list( read.csv(path)) q <- readNWISuv( siteNumbers = siteno, "00060", "2015-10-10", "2015-10-11")
This is the error I get Request failed [400]. Retrying in 1 seconds... Request failed [400]. Retrying in 2.5 seconds... Error in getWebServiceData(obs_url, encoding = "gzip") : HTTP Status 400 - unrecognized character in input sequence: position=[4]