Closed jmmallard closed 1 year ago
NWIS only allows one state to be queried at a time. This is done as a way to limit the web service queries a bit.
This issue is reminding me I need to add a check to make sure only 1 state is being queried and give the user a more user-friendly error message if that's not true.
Luckily for you, we just added a new article to the documentation that describes how to do a large data pull via a loop of states. It's written for the Water Quality Portal, but you should be able to adjust it to NWIS. Let me know if you have any questions:
https://rconnect.usgs.gov/dataRetrieval/articles/wqp_large_pull_script.html
Lucky indeed! Much appreciated
Description When multiple state codes are used as an input to readNWISdata, the following error is generated: Error in if (values["stateCd"] == "UM") { : missing value where TRUE/FALSE needed
To Reproduce
Expected behavior Expected this to provide output for all gauges in both Oregon and Washington
Session Info
Additional context Also reproduced with different states, and by using different columns from the stateCd table.