blankTime and plotFluxHist or plotConcHist function
Created by: rmhirsch49
There is a problem when a user sets up a blankTime period that has a start and/or end date that is not alligned with the period of analysis for these graphs (it might also apply to some of the tables).
Say I do this: plotFluxHist(eList) startBlank <- "2000-01-01" endBlank <- "2003-12-31" eList <- blankTime(eList,startBlank,endBlank) plotFluxHist(eList)
The result we would like is that the two graphs look exactly the same but the latter one will just have a part of the green line vanish and several dots vanish, but no values get changed. In fact, what happens is that the partial water years that haven't been blanked out still figure in so there can be a sharp bend in the green curves next to the break and the data points near the break have moved around.
What needs to happen is that these functions plotConcHist and plotFluxHist need to be modified so that if there are any NA values in a given year within the PA it won't compute a value for that year and it will be NA for purposes of the graph.
I've done a little test case and can see that the problem exists also in setupYears, tableResults and tableChange as well.
At first glance I thought the solution was just to make sure that the blankStart and blankEnd defined a water year, but then I realized that the user may want to look at calendar year or some other PA and the problem really wouldn't be solved.
I think all of this can be fixed with a fix to setupYears (because all of these functions that show the problem depend on setupYears for their annual values).
I think the fix is simply this: In setupYears the line that says:
good <- (sum(counter) > 25)
should actually say
good <- (sum(counter) == length(counter))
I think the sum(counter) > 25 is a relic from when we were doing this summing by month and I wanted there to be at least 25 valid days in the month to make it work).
Probably needs to be fixed on CRAN and on our internal version of EGRET
Thanks. Bob