EGRET issueshttps://code.usgs.gov/water/EGRET/-/issues2023-02-28T19:25:37Zhttps://code.usgs.gov/water/EGRET/-/issues/155Multiple Samples on same day and Kalman behavior2023-02-28T19:25:37ZLoken, Luke CliftonMultiple Samples on same day and Kalman behaviorLooking at the code for `WRTDSkalman()`, I am wondering if this is how multiple samples per day is intended to function. Here the function `cleanup()` will randomly subset the data to one sample per day.
https://code.usgs.gov/water/EGR...Looking at the code for `WRTDSkalman()`, I am wondering if this is how multiple samples per day is intended to function. Here the function `cleanup()` will randomly subset the data to one sample per day.
https://code.usgs.gov/water/EGRET/-/blob/main/R/kalman_functions.R#L49
This makes sense, but this step takes place outside the iteration loop. So each of the `niter` iterations will use the same random dataset. There is probably a reason for this, but why the random selection of a value is not inside the loop.
Lukehttps://code.usgs.gov/water/EGRET/-/issues/154mergeReport doesn't consistently print out summary information, depending upo...2023-01-27T22:40:54ZMullaney, John R.mergeReport doesn't consistently print out summary information, depending upon which water-quality parameter is usedWhen using mergeReport, I only get the summary information for certain parameters and not others
The first example below works and it prints the summary. However if I change the parameter to "00608", it doesn't provide the summary.
I hav...When using mergeReport, I only get the summary information for certain parameters and not others
The first example below works and it prints the summary. However if I change the parameter to "00608", it doesn't provide the summary.
I have been collecting the summary for each of these as part of the archive for the project.
library(EGRET)
BeginDate <- "1994-10-01"
EndDate <- "2021-09-30"
Site <- "01192500"
parm <- "00600"
Sample<-readNWISSample(Site,parm,BeginDate,EndDate)
Daily <- readNWISDaily(Site,"00060",BeginDate,EndDate)
INFO<-readNWISInfo(siteNumber=Site, parameterCd = parm,interactive = FALSE)
eList <- mergeReport(INFO, Daily, Sample, verbose = T)https://code.usgs.gov/water/EGRET/-/issues/153Review of TrendsByMonth and units articles2023-01-04T16:11:31ZMatt DiebelReview of TrendsByMonth and units articles## Package Review
This review is limited to the TrendsByMonth and units articles. I did not assess the overall package documentation and functionality.
- **Briefly describe any working relationship you have (had) with the package autho...## Package Review
This review is limited to the TrendsByMonth and units articles. I did not assess the overall package documentation and functionality.
- **Briefly describe any working relationship you have (had) with the package authors.**
I have discussed the package and its development with the authors several times.
- [X] As the reviewer I confirm that there are no conflicts of interest for me to review this work.
Estimated hours spent reviewing: 2
- [X] Should the author(s) deem it appropriate, I agree to be acknowledged as a package reviewer ("rev" role) in the package DESCRIPTION file.
### Review Comments
**TrendsByMonth article**
- The trends by month article uses Conowingo.PO4.RData, but this dataset is not included in the EGRET package, so I substituted the Choptank data:
```
eList <- Choptank_eList
pairResults <- runPairs(eList, windowSide = 0,
paStart = 1, paLong = 12,
year1 = 1980, year2 = 2010)
```
- I suggest adding a '+' to change estimates that are positive. I assume decreases are denoted with a '-'. In my example, one line in the result would be: Concentration v. Q Trend Component +50 %
- I don't see the "byMonth" attribute in pairResults. Is 3.0.7.2 on CRAN? I only see the version as 3.0.7.
- Some typos in this passage: 'To see the tabular output of the results, use the “byMonth” attribute from the runPairs result. Here we show a few years of the months output:'
- The plotMonthTrend function is not defined in the article, so if the function is going to be included in the EGRET package I would revise the next passage to read: 'Next, let’s plot the results using the plotMonthTrend function:' Otherwise, define the function in the article.
- Because the plotMonthTrend function was not defined, I couldn't review it.
**units article**
- Grammar edits in this sentence: Each “slot” in this qUnit object is required, and the qShortName, qUnitName, unitUSGS, and prefix must be characters.
- All code with the `new()` function gives an error (below). Might be related to the EGRET version mentioned above.
```
Error in initialize(value, ...) :
invalid name for slot of class “qUnit”: prefix
```
- Under 'Data Input', edit first sentence to read: 'Discharge data in units other than m^3/s can be used as input in EGRET, but that data will be converted to m^3/s with the qUnit argument when the eList is created.'
If the problems I had with the code are related the EGRET version and you can point me to the correct version, I can redo this review.https://code.usgs.gov/water/EGRET/-/issues/152Error in wBT(eList, caseSetUp, fileName = "WBT.txt")2018-08-02T19:26:12ZLaura A DeCiccoError in wBT(eList, caseSetUp, fileName = "WBT.txt")*Created by: t4chandr*
Hello,
I keep getting the following error when I try running the WRTDS bootstrap test in both the interactive and batch modes.
Error in wBT(eList, caseSetUp, fileName = "WBT.txt") :
Error in resultSurvRe...*Created by: t4chandr*
Hello,
I keep getting the following error when I try running the WRTDS bootstrap test in both the interactive and batch modes.
Error in wBT(eList, caseSetUp, fileName = "WBT.txt") :
Error in resultSurvReg[k, ]: subscript out of bounds
/nNANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANAN
I'm using the following parameters: year1=2007, year2=2015, nBoot = 50, bootBreak = 9, blockLength = 50, and I have 224 samples for this site.
Has anyone else had this issue, or is this an issue with EGRETci? I'm a relatively new R user, and any help would be greatly appreciated!https://code.usgs.gov/water/EGRET/-/issues/149NaN results in runPairsBootAltC2023-01-03T18:01:04ZLaura A DeCiccoNaN results in runPairsBootAltC*Created by: rmhirsch49*
Laura: Out of thousands of runs of runPairsBootAltC I have gotten the estimates on one or a few bootstrap replicates coming back as NaN values for both trend in concentration and trend in flux. The program kee...*Created by: rmhirsch49*
Laura: Out of thousands of runs of runPairsBootAltC I have gotten the estimates on one or a few bootstrap replicates coming back as NaN values for both trend in concentration and trend in flux. The program keeps running, but when it gets to the end it crashes as it tries to bring together all of the summary statistics on the bootstrap runs. So, I may have done 500 replicates but at the end it just crashes and I get nothing. It would be nice if we could do a fail safe method on this problem.
Thanks. Bobhttps://code.usgs.gov/water/EGRET/-/issues/144plotSDlogQ: Adding minimum value for y-axis?2018-08-02T19:26:12ZLaura A DeCiccoplotSDlogQ: Adding minimum value for y-axis?*Created by: tungmilan*
Hello,
There is a sdMax option but can you guys add an option for minimum value (e.g. sdMin) as well?
https://github.com/USGS-R/EGRET/blob/master/R/plotSDLogQ.R
![plotsdq](https://user-images.githubuser...*Created by: tungmilan*
Hello,
There is a sdMax option but can you guys add an option for minimum value (e.g. sdMin) as well?
https://github.com/USGS-R/EGRET/blob/master/R/plotSDLogQ.R
![plotsdq](https://user-images.githubusercontent.com/6590141/36076176-8688ef0a-0f0d-11e8-8cc2-5a33395ae00b.PNG)
Thanks!https://code.usgs.gov/water/EGRET/-/issues/143plotFour & plotSDLogQ errors2018-08-02T19:26:12ZLaura A DeCiccoplotFour & plotSDLogQ errors*Created by: tungmilan*
Hello,
I tried `plotFour` & `plotSDLogQ` for my data but got the following errors
```
Error in seq.default(startDec, endDec - window, 0.1) :
wrong sign in 'by' argument
```
How should I fix this? T...*Created by: tungmilan*
Hello,
I tried `plotFour` & `plotSDLogQ` for my data but got the following errors
```
Error in seq.default(startDec, endDec - window, 0.1) :
wrong sign in 'by' argument
```
How should I fix this? Thank you!
**Sample R code:**
```
startDate <- '2007-10-01'
endDate <- '2017-09-30'
station_code <- "12488500"
data_code <- "00060"
dat <- readNWISDaily(station_code, data_code, startDate, endDate)
INFO <- readNWISInfo(station_code, data_code)
eList <- as.egret(INFO, dat , NA, NA)
#### Check flow history data:
plotFourStats(eList, qUnit = 1)
plotSDLogQ(eList)
plotFour(eList, qUnit = 1)
```
https://code.usgs.gov/water/EGRET/-/issues/142Y-axis of plotContours: is possible not to plot in log transformed flow?2023-01-03T18:01:18ZLaura A DeCiccoY-axis of plotContours: is possible not to plot in log transformed flow?*Created by: ghost*
Thanks for reading this. I noticed that the function of plotContours will automatically plot y-axis as log-transformed stream discharge. Is there a way to plot the discharge without log-transforming data?
Thank y...*Created by: ghost*
Thanks for reading this. I noticed that the function of plotContours will automatically plot y-axis as log-transformed stream discharge. Is there a way to plot the discharge without log-transforming data?
Thank you.
Wenlonghttps://code.usgs.gov/water/EGRET/-/issues/139Make mergeReport more flexible2023-01-03T18:01:58ZLaura A DeCiccoMake mergeReport more flexibleI would like to do this:
```
eList <- mergeReport(eListOld, Sample)
```
and it only replace the Sample dfI would like to do this:
```
eList <- mergeReport(eListOld, Sample)
```
and it only replace the Sample dfhttps://code.usgs.gov/water/EGRET/-/issues/137Allow for right-censored data2023-01-03T18:01:29ZLaura A DeCiccoAllow for right-censored data*Created by: limnoliver*
Currently, only `<` is recognized as a censored value, and when `>` appears in the QW data, the value is documented as uncensored and ConcLow and ConcHigh are equal. Per `survival` package documentation, ConcLow...*Created by: limnoliver*
Currently, only `<` is recognized as a censored value, and when `>` appears in the QW data, the value is documented as uncensored and ConcLow and ConcHigh are equal. Per `survival` package documentation, ConcLow should be the censored value, and ConcHigh should be `NA`.
This requires changes to `populateConcentrations` and `populateSampleColumns`.https://code.usgs.gov/water/EGRET/-/issues/134installing EGRET2018-08-02T19:26:12ZLaura A DeCiccoinstalling EGRET*Created by: dwhydro*
I received this response:
The downloaded binary packages are in C:\Users\10002932\AppData\Local\Temp\1\RtmpSKjO8I\downloaded_packages > library(dataRetrieval) Warning message: package ‘dataRetrieval’ was built ...*Created by: dwhydro*
I received this response:
The downloaded binary packages are in C:\Users\10002932\AppData\Local\Temp\1\RtmpSKjO8I\downloaded_packages > library(dataRetrieval) Warning message: package ‘dataRetrieval’ was built under R version 3.3.3 > library(EGRET) Warning messages: 1: package ‘EGRET’ was built under R version 3.3.3 **2: failed to assign RegisteredNativeSymbol for toeplitz to toeplitz since toeplitz is already defined in the ‘spam’ namespace**
--
> | >
>Any suggestions on what to do next?
https://code.usgs.gov/water/EGRET/-/issues/126Remove RColorBrewer dependency2018-08-02T19:26:12ZLaura A DeCiccoRemove RColorBrewer dependencyIt's only in the new function `flexPlotAddOn `. We could either make our own, or use a built-in one from base, or just make it an argument to the function (with some intelligent defaults)It's only in the new function `flexPlotAddOn `. We could either make our own, or use a built-in one from base, or just make it an argument to the function (with some intelligent defaults)Lindsay R CarrLindsay R Carrhttps://code.usgs.gov/water/EGRET/-/issues/122Add flexible flow normalization to setupYears2018-08-02T19:26:12ZLaura A DeCiccoAdd flexible flow normalization to setupYearshttps://code.usgs.gov/water/EGRET/-/issues/121Add flexible flow normalization to setupYears2023-01-03T18:01:48ZLaura A DeCiccoAdd flexible flow normalization to setupYearsOK... here it goes. We already have a function `flexFN` that let's you permanently set the flow-normalized calculations to some set of years. This issue is both a simplification of that function, and only temporary. It can either be call...OK... here it goes. We already have a function `flexFN` that let's you permanently set the flow-normalized calculations to some set of years. This issue is both a simplification of that function, and only temporary. It can either be called within `setupYears`, or before. It would probably be easiest to implement by putting it within `setupYears`, and setting a default argument to use the full period of record.
The function `flexFN` takes a data frame with 3 columns, the first represents where to split the surface, the second and 3rd where to split the discharge.
Instead of that workflow, I'd say we'll only concentrate on discharge, with a single vector of dates to normalize on.
- [x] Add more tests to `setupYears`
- [x] Improve documentation to `estFNsegs`
- [x] Create function to use vector of years.
- [x] Add it to functions before `setupYears`
- [ ] Double-check all the output for those functions that call `setupYears` (many are graphing functions)
- [ ] Add examples to functions that call `setupYears`
- [ ] Write mini-vignette/blog.
@lindsaycarr I'm going to do a couple of these first tasks this afternoon to get it started. I'll have you review whatever PR I end up completing and then you take over from there.https://code.usgs.gov/water/EGRET/-/issues/119Helper functions2018-08-02T19:26:12ZLaura A DeCiccoHelper functions- [ ] `nObs <- nObservations(eList)`
- [ ] `nCensoredVals(eList)`
- [ ] `plot(eList)`
others?- [ ] `nObs <- nObservations(eList)`
- [ ] `nCensoredVals(eList)`
- [ ] `plot(eList)`
others?Lindsay R CarrLindsay R Carrhttps://code.usgs.gov/water/EGRET/-/issues/104Convert readme to readme.Rmd and get graphs to plot2018-08-02T19:26:12ZLaura A DeCiccoConvert readme to readme.Rmd and get graphs to plotI think you could take the readme as it is, save it as a .Rmd file, add the appropriate header, `knit` it, and we'd have a fancy readme with lots of graphs. This could then be the "testing platform" for our graphs:
```
---
title: "R...I think you could take the readme as it is, save it as a .Rmd file, add the appropriate header, `knit` it, and we'd have a fancy readme with lots of graphs. This could then be the "testing platform" for our graphs:
```
---
title: "README"
author: "R"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
md_document:
variant: markdown_github
---
```
Also would need to remember to add the .Rmd and corresponding images to the .RbuildignoreLindsay R CarrLindsay R Carrhttps://code.usgs.gov/water/EGRET/-/issues/103Add tests to table output and other functions2018-08-02T19:26:12ZLaura A DeCiccoAdd tests to table output and other functions- [x] calculateMonthlyResults
- [x] censoredSegments
- [x] checkStartEndDate
- [x] compressData
- [x] dateFormatCheck
- [x] flowDuration
- [x] formatCheckDate
- [x] formatCheckParameterCd
- [x] logPretty1
- [x] logPretty3
...- [x] calculateMonthlyResults
- [x] censoredSegments
- [x] checkStartEndDate
- [x] compressData
- [x] dateFormatCheck
- [x] flowDuration
- [x] formatCheckDate
- [x] formatCheckParameterCd
- [x] logPretty1
- [x] logPretty3
- [x] makeAnnualSeries
- [x] makeAugmentedSample this doesn't have an example either
- [x] setSeasonLabel
- [x] mergeReport
- [x] populateConcentrations better documentation - what actually are the columns?
- [x] selectDays
- [x] setPA
- [x] generalAxis
- [x] fluxBiasStat
Upon adding tests with the Choptank and/or Arkansas sample data, look for places to add intermediate functions. I expect fewer intermediate functions needed here than #102 David WatkinsDavid Watkinshttps://code.usgs.gov/water/EGRET/-/issues/102Add tests to modeling functions2018-08-02T19:26:12ZLaura A DeCiccoAdd tests to modeling functions- [x] modelEstimation
- [x] estCrossVal
- [x] estSurfaces
- [x] runSurvReg
- [x] estDailyFromSurfaces
Upon adding tests with the Choptank and/or Arkansas sample data, look for places to add intermediate functions.- [x] modelEstimation
- [x] estCrossVal
- [x] estSurfaces
- [x] runSurvReg
- [x] estDailyFromSurfaces
Upon adding tests with the Choptank and/or Arkansas sample data, look for places to add intermediate functions.Lindsay R CarrLindsay R Carrhttps://code.usgs.gov/water/EGRET/-/issues/101package or namespace load failed for ‘EGRET’2018-08-02T19:26:12ZLaura A DeCiccopackage or namespace load failed for ‘EGRET’*Created by: tungmilan*
I'm having the following issue when loading EGRET. Something wrong related to dplyr?
```
> library(EGRET)
Error: package or namespace load failed for ‘EGRET’:
object ‘rbind_all’ is not exported by 'namespa...*Created by: tungmilan*
I'm having the following issue when loading EGRET. Something wrong related to dplyr?
```
> library(EGRET)
Error: package or namespace load failed for ‘EGRET’:
object ‘rbind_all’ is not exported by 'namespace:dplyr'
> devtools::session_info()
Session info -----------------------------------------------------------------------------------------------------------------
setting value
version R version 3.4.0 (2017-04-21)
system x86_64, mingw32
ui RStudio (1.0.143)
language (EN)
collate English_United States.1252
tz America/Los_Angeles
date 2017-05-08
Packages ---------------------------------------------------------------------------------------------------------------------
package * version date source
assertthat 0.2.0 2017-04-11 CRAN (R 3.4.0)
curl 2.6 2017-04-27 CRAN (R 3.4.0)
devtools 1.12.0 2016-12-05 CRAN (R 3.4.0)
digest 0.6.12 2017-01-27 CRAN (R 3.4.0)
dplyr 0.5.0.9004 2017-05-01 Github (hadley/dplyr@106070a)
glue 1.0.0 2017-05-01 Github (tidyverse/glue@650d0d3)
lubridate 1.6.0 2016-09-13 CRAN (R 3.3.1)
magrittr 1.5 2014-11-22 CRAN (R 3.4.0)
memoise 1.1.0 2017-04-21 CRAN (R 3.4.0)
R6 2.2.0 2016-10-05 CRAN (R 3.4.0)
Rcpp 0.12.10.2 2017-05-01 Github (RcppCore/Rcpp@c57b754)
rlang 0.0.0.9018 2017-05-01 Github (hadley/rlang@b22ce1c)
stringi 1.1.5 2017-04-07 CRAN (R 3.4.0)
stringr 1.2.0 2017-02-18 CRAN (R 3.4.0)
tibble 1.3.0.9001 2017-04-24 Github (tidyverse/tibble@08af6b0)
withr 1.0.2 2016-06-20 CRAN (R 3.4.0)
```
Thanks!
Tunghttps://code.usgs.gov/water/EGRET/-/issues/100Data Retrieval not retrieving NDs2018-08-02T19:26:12ZLaura A DeCiccoData Retrieval not retrieving NDs*Created by: jmacart*
Data Retrieval is not retrieving NDs for any MN data stored after 2002 or so. I get the concentration reports as 0 message although the concentration was not reported as 0 and our statewide data retrieval has no p...*Created by: jmacart*
Data Retrieval is not retrieving NDs for any MN data stored after 2002 or so. I get the concentration reports as 0 message although the concentration was not reported as 0 and our statewide data retrieval has no problem getting it. Following is the sample retrieval code:
siteNumber <- "MNPCA-S002-010"
> characteristicName <- "Inorganic nitrogen (nitrate and nitrite)"
> startDate <- "1992-01-01"
> endDate <- "2015-12-31"
> Sample <- readWQPSample(siteNumber, characteristicName, startDate,endDate)
Deleted Rows:
dateTime ConcLow ConcHigh Uncen
4 2010-09-20 0 0 1
5 2010-10-20 0 0 1
8 2010-10-12 0 0 1
11 2010-07-13 0 0 1
13 2010-07-27 0 0 1
15 2010-04-21 0 0 1
17 2010-08-09 0 0 1
18 2010-05-19 0 0 1
19 2010-07-07 0 0 1
20 2011-11-01 0 0 1
22 2011-09-13 0 0 1
23 2011-11-16 0 0 1
25 2011-06-15 0 0 1
27 2011-05-18 0 0 1
33 2011-05-09 0 0 1
36 2011-06-08 0 0 1
45 2013-10-09 0 0 1
51 2013-08-06 0 0 1
53 2013-05-29 0 0 1
54 2013-08-27 0 0 1
58 2005-08-17 0 0 1
59 2010-12-06 0 0 1
60 2010-01-12 0 0 1
63 2010-08-23 0 0 1
64 2010-11-22 0 0 1
65 2010-06-08 0 0 1
67 2010-05-13 0 0 1
68 2010-05-26 0 0 1
69 2010-10-05 0 0 1
74 2004-10-20 0 0 1
84 2008-10-07 0 0 1
87 2008-09-09 0 0 1
88 2008-07-09 0 0 1
90 2008-11-04 0 0 1
92 2008-12-09 0 0 1
96 2007-05-14 0 0 1
97 2009-05-13 0 0 1
98 2009-04-22 0 0 1
101 2009-07-29 0 0 1
102 2009-09-15 0 0 1
105 2009-05-20 0 0 1
107 2009-08-11 0 0 1
109 2009-06-23 0 0 1
110 2009-08-26 0 0 1
111 2009-04-29 0 0 1
112 2009-07-14 0 0 1
113 2009-05-06 0 0 1
114 2009-12-01 0 0 1
115 2009-06-09 0 0 1
120 2013-06-17 0 0 1
123 2013-09-10 0 0 1
125 2013-09-25 0 0 1
128 2005-04-20 0 0 1
131 2005-08-31 0 0 1
132 2005-05-18 0 0 1
134 2005-11-02 0 0 1
136 2005-05-11 0 0 1
137 2005-09-14 0 0 1
138 2005-05-23 0 0 1
140 2005-08-03 0 0 1
141 2005-04-27 0 0 1
143 2005-05-04 0 0 1
149 2012-10-17 0 0 1
151 2012-06-25 0 0 1
152 2012-07-02 0 0 1
153 2012-04-10 0 0 1
154 2012-05-14 0 0 1
155 2012-06-05 0 0 1
162 2012-04-30 0 0 1
165 2012-05-22 0 0 1
167 2012-09-11 0 0 1
168 2012-11-07 0 0 1
170 2007-07-17 0 0 1
172 2007-05-21 0 0 1
173 2007-06-26 0 0 1
174 2007-08-27 0 0 1
184 2007-09-17 0 0 1
195 2015-05-11 0 0 1
198 2015-04-28 0 0 1
200 2015-10-27 0 0 1
201 2015-08-03 0 0 1
202 2015-04-13 0 0 1
204 2015-06-23 0 0 1
205 2015-09-22 0 0 1
207 2015-08-25 0 0 1
215 2015-11-04 0 0 1
258 2006-06-21 0 0 1
259 2006-09-27 0 0 1
260 2006-07-17 0 0 1
262 2006-08-23 0 0 1
264 2006-09-05 0 0 1
265 2006-06-07 0 0 1
266 2006-04-19 0 0 1
267 2006-05-10 0 0 1
270 2006-08-02 0 0 1
272 2009-10-07 0 0 1
275 2014-10-28 0 0 1
283 2014-05-27 0 0 1
284 2014-09-30 0 0 1
285 2014-09-08 0 0 1
289 2014-11-25 0 0 1
Warning message:
In compressData(data, interactive = interactive) :
Deleted 101 rows of data because concentration was reported as 0.0, the program is unable to interpret that result and is therefore deleting it.
>
Thank You