Closed cristinamullin closed 1 year ago
Ha that's an interesting bug! The reason is because we're converting some "ResultCount" and other "Count" columns to numbers....but it's including the "County" too. The fix should be up shortly.
As for INPUTTING county codes, I'm still mulling the best way to do it now that we know there's a difference between NWIS and WQP.
Interesting lol, that'll do it! Thank you for fixing!
Yeah, this is a little challenging since there are a few potential domain lists. My understanding is that the WQP includes the list of counties with data available in the WQP (it is a subset of the ones from WQX or NWIS with data): https://www.waterqualitydata.us/Codes/countycode. I could be wrong though. The other domain lists (WQX and NWIS specific) vary slightly in that they include some areas without data. But the extra areas are included because they are valid areas for new submissions (i.e., WQX: https://cdx.epa.gov/wqx/download/DomainValues/County_CSV.zip). Not sure where to find NWIS's most recent domain tables. Let me know what you decide. Thanks again!
Yeah, the NWIS list is pretty static so including the data directly in dataRetrieval is no problem. The WQP seems more dynamic, so it looks like we're going to need to rethink the entire stateCdLookup and countyCdLookup functions to dynamically call those tables. That in itself is not a huge task, but I'm looking into what are the differences between NWIS and WQP so the user doesn't actually need to care if they're calling a county code in NWIS or if they're calling a county code in WQP.
Describe the bug
CountyCode missing leading '0' or '00'
If you are using the csv file format to bring data into R via the WQP web services, that may causing the issue.
For example:
CSV output https://www.waterqualitydata.us/data/Station/search?statecode=US%3A02&countycode=US%3A02%3A270&**mimeType=csv**&zip=no&providers=NWIS&providers=STEWARDS&providers=STORET
VS.
XLSX output https://www.waterqualitydata.us/data/Station/search?statecode=US%3A02&countycode=US%3A02%3A270&**mimeType=xlsx**&zip=no&providers=NWIS&providers=STEWARDS&providers=STORET
To Reproduce
Expected behavior Expect dataRetreival to return a dataframe with the the leading '0' or '00' included in the CountyCode
Session Info Please include your session info: