Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readNWISSample Error #388

Open
raruggie opened this issue Feb 6, 2025 · 2 comments
Open

readNWISSample Error #388

raruggie opened this issue Feb 6, 2025 · 2 comments

Comments

@raruggie
Copy link

raruggie commented Feb 6, 2025

I am getting the following error when using EGRET::readNWISSample:

>   siteNumber <-  "04220045"
>   ParameterCd <- '00665'
>   StartDate <- "2010-06-17"
>   EndDate <- "2019-11-28"
>   Sample <- readNWISSample(siteNumber, ParameterCd, StartDate, EndDate)

Error in `[.data.frame`(data, , c("agency_cd", "site_no")) :                                                               
  undefined columns selected
In addition: Warning messages:
1: NWIS qw web services are being retired.
Please see vignette('qwdata_changes', package = 'dataRetrieval')
for more information.
https://cran.r-project.org/web/packages/dataRetrieval/vignettes/qwdata_changes.html 
2: In readLines(f) :
  incomplete final line found on 'C:\Users\ryrug\AppData\Local\Temp\RtmpW0AVhG\file3228785379f0'

In the source code for EGRET::readNWISSample I see it uses dataRetrieval::readNWISqw which has been retired and is replaced by dataRetrieval::readWQPqw. Is there an updated version of the EGRET::readNWISSample function that uses the updated WQP function?

I am using EGRET 3.0.9 and R 4.3.3.

Thank you for any help with this.

@ldecicco-USGS
Copy link
Collaborator

If you update EGRET to the version on CRAN (3.0.10):
https://cran.r-project.org/web/packages/EGRET/index.html
That function was updated. It should work the same, but it now calls WQP instead of the decommissioned NWIS service.

@raruggie
Copy link
Author

raruggie commented Feb 6, 2025

thank you for the quick reply. This fixed my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants