Skip to content

Commit

Permalink
Suppressed Loess related warnings in iAddLoessLine
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Ogle committed Sep 22, 2016
1 parent ebb2681 commit b49971b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* `confint.nlsBoot()`,`confint.bootCase()`. Modified. Result is now a matrix even if only one parameter is chosen (previously it was an unnamed vector). The `parm=` now properly handles negative values. Streamlined plotting results. Added tests.
* `depletion()`: Modified. Checked for bad `conf.level=` in `confint()` method.
* `htest.nlsBoot()`,`htest.bootCase()`. Modified. The `b0` now defaults to 0. Matrix of results now include the parameter as the rowname. Modified the internals of how the data are handled. Added tests.
* `iAddLoessLine()`: Modified. Suppressed warnings related to the loess line predictions.
* `mrClosed()`: Modified. Checked for bad `conf.level=` in `confint()` method.
* `mrOpen()`: Modified. Checked for bad `conf.level=` in `confint()` method.
* `predict.nlsBoot()`, `predict.bootCase()`. Modified. The `...` argument can now contain a vector of values such that predictions can be made for multiple values of the independent variable. Modified the output matrix to handle this modification. Removed `MARGIN` as it will always be `1` for `nlsBoot` and `bootCase` objects. Added checks for `FUN=`, `conf.level=`, and `digits=`. Added tests.
Expand Down
2 changes: 2 additions & 0 deletions R/FSA-internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@


iAddLoessLine <- function(r,fv,lty.loess,lwd.loess,col.loess,trans.loess,span=0.75) {
options(warn=-1) # suppress warnings from loess
mdl <- stats::loess(r~fv,span=span)
xseq <- seq(from=min(fv),to=max(fv),length=80)
pred <- stats::predict(mdl,newdata=data.frame(fv=xseq),se=TRUE)
options(warn=0) # unsuppress warnings
graphics::polygon(c(xseq,rev(xseq)),
c(pred$fit-pred$se.fit*stats::qt(0.975,pred$df),
rev(pred$fit+pred$se.fit*stats::qt(0.975,pred$df))),
Expand Down

0 comments on commit b49971b

Please sign in to comment.