Skip to content

Commit

Permalink
Merge pull request #81 from ldecicco-USGS/master
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
ldecicco-USGS committed Apr 20, 2016
2 parents bf3a9c6 + 616ae1f commit 8fe6445
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 45 deletions.
59 changes: 28 additions & 31 deletions R/multiPlotDataOverview.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,34 @@
#' multiPlotDataOverview(eList, qUnit=1)
multiPlotDataOverview<-function (eList, qUnit = 2,cex.main=1.2,rResid=FALSE,
logScaleConc=TRUE, logScaleQ=TRUE){

multiPlotDataOverview<-function (eList, qUnit = 2,cex.main=1.2,
logScaleConc=TRUE, logScaleQ=TRUE,rResid=FALSE){

localINFO <- getInfo(eList)

if(sum(c("paStart","paLong") %in% names(localINFO)) == 2){
paLong <- localINFO$paLong
paStart <- localINFO$paStart
} else {
paLong <- 12
paStart <- 10
}

title2<-if(paLong==12) "" else setSeasonLabelByUser(paStartInput=paStart,paLongInput=paLong)

par(mfcol=c(2,2),oma=c(0,2.4,4.5,2.4),tcl=0.5)
plotConcQ(eList, qUnit = qUnit, tinyPlot = TRUE, printTitle = FALSE,
rmSciX=TRUE,logScale=logScaleConc,rResid=rResid)
boxConcMonth(eList, printTitle = FALSE, tinyPlot=TRUE,logScale=logScaleConc)
plotConcTime(eList, printTitle = FALSE, tinyPlot = TRUE,logScale=logScaleConc,rResid=rResid)
boxQTwice(eList, printTitle = FALSE, qUnit = qUnit, tinyPlot=TRUE,logScale=logScaleQ)
title<-paste(localINFO$shortName,"\n",localINFO$paramShortName)

if("" == title2){
mtext(title,cex=cex.main,outer=TRUE,font=2)
} else {
title <- paste(title, title2, sep="\n")
mtext(title, cex = cex.main*.75, outer = TRUE, font = 2)
}

par(mfcol=c(1,1),oma=c(0,0,0,0))
localINFO <- getInfo(eList)

if(sum(c("paStart","paLong") %in% names(localINFO)) == 2){
paLong <- localINFO$paLong
paStart <- localINFO$paStart
} else {
paLong <- 12
paStart <- 10
}

title2<-if(paLong==12) "" else setSeasonLabelByUser(paStartInput=paStart,paLongInput=paLong)

par(mfcol=c(2,2),oma=c(0,2.4,4.5,2.4),tcl=0.5)
plotConcQ(eList, qUnit = qUnit, tinyPlot = TRUE, printTitle = FALSE,
rmSciX=TRUE,logScale=logScaleConc,rResid=rResid)
boxConcMonth(eList, printTitle = FALSE, tinyPlot=TRUE,logScale=logScaleConc)
plotConcTime(eList, printTitle = FALSE, tinyPlot = TRUE,logScale=logScaleConc,rResid=rResid)
boxQTwice(eList, printTitle = FALSE, qUnit = qUnit, tinyPlot=TRUE,logScale=logScaleQ)
title<-paste(localINFO$shortName,"\n",localINFO$paramShortName)

if("" == title2){
mtext(title,cex=cex.main,outer=TRUE,font=2)
} else {
title <- paste(title, title2, sep="\n")
mtext(title, cex = cex.main*.75, outer = TRUE, font = 2)
}

par(mfcol=c(1,1),oma=c(0,0,0,0))

}
Binary file modified inst/doc/EGRET.pdf
Binary file not shown.
5 changes: 4 additions & 1 deletion inst/doc/rResid.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ plotConcTime(eList)
## ------------------------------------------------------------------------
plotConcQ(eList,qUnit=4)

## ------------------------------------------------------------------------
plotResidQ(eList,qUnit=4)

## ------------------------------------------------------------------------
eList <- makeAugmentedSample(eList)
plotConcQ(eList, qUnit = 4, rResid = TRUE)
Expand All @@ -20,7 +23,7 @@ plotResidQ(eList, qUnit = 4, rResid = TRUE)
## ----eval=FALSE----------------------------------------------------------
# eList <- makeAugmentedSample(eList)

## ------------------------------------------------------------------------
## ----fig.height=8, fig.width=8-------------------------------------------
multiPlotDataOverview(eList, qUnit = 4, rResid = TRUE)

## ----fig.height=10, fig.width=8------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions inst/doc/rResid.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ plotConcQ(eList,qUnit=4)

It is difficult to see the relationship between ammonia concentration and discharge. If we look at residuals from a fitted WRTDS model and discharge we also find it difficult to see if the pattern looks reasonable (a horizontal cloud of points centered on the zero residual line) or if there is some substantial curvature to the relationship.

```{}
```{r}
plotResidQ(eList,qUnit=4)
```

Expand Down Expand Up @@ -86,9 +86,8 @@ eList <- makeAugmentedSample(eList)
4. To produce any one of the following graphics, using the `rObserved` or `rResid` values simply add the argument `rResid = TRUE` to the call to the graphical function. Note that it doesn't matter if what is being plotted is an observed value or a residual, the argument is always `rResid = TRUE`. The original option of showing the vertical lines for censored values remains available as the default for any of these functions. The call can either say `rResid = FALSE` or just not include `rResid` in the argument list and the graphs will appear without these random values and without the open circle/closed circle symbology. The functions where this approach applies are these: `plotConcPred, plotConcQ, plotConcTime, plotConcTimeDaily, plotFluxPred, plotFluxQ, plotFluxTImeDaily, plotResidPred, plotResidQ, plotResidTime`. It is also available in the two multiple plot functions: `multiPlotOverview`, and `fluxBiasMulti`.

For example.

```{r}
```{r fig.height=8, fig.width=8}
multiPlotDataOverview(eList, qUnit = 4, rResid = TRUE)
```

Expand Down
15 changes: 8 additions & 7 deletions inst/doc/rResid.html

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions vignettes/rResid.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ plotConcQ(eList,qUnit=4)

It is difficult to see the relationship between ammonia concentration and discharge. If we look at residuals from a fitted WRTDS model and discharge we also find it difficult to see if the pattern looks reasonable (a horizontal cloud of points centered on the zero residual line) or if there is some substantial curvature to the relationship.

```{}
```{r}
plotResidQ(eList,qUnit=4)
```

Expand Down Expand Up @@ -86,9 +86,8 @@ eList <- makeAugmentedSample(eList)
4. To produce any one of the following graphics, using the `rObserved` or `rResid` values simply add the argument `rResid = TRUE` to the call to the graphical function. Note that it doesn't matter if what is being plotted is an observed value or a residual, the argument is always `rResid = TRUE`. The original option of showing the vertical lines for censored values remains available as the default for any of these functions. The call can either say `rResid = FALSE` or just not include `rResid` in the argument list and the graphs will appear without these random values and without the open circle/closed circle symbology. The functions where this approach applies are these: `plotConcPred, plotConcQ, plotConcTime, plotConcTimeDaily, plotFluxPred, plotFluxQ, plotFluxTImeDaily, plotResidPred, plotResidQ, plotResidTime`. It is also available in the two multiple plot functions: `multiPlotOverview`, and `fluxBiasMulti`.

For example.

```{r}
```{r fig.height=8, fig.width=8}
multiPlotDataOverview(eList, qUnit = 4, rResid = TRUE)
```

Expand Down

0 comments on commit 8fe6445

Please sign in to comment.