Skip to content

Commit

Permalink
simplify example in draw.gam
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinsimpson committed Jan 23, 2021
1 parent 7071cf8 commit 1aa7c50
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
12 changes: 5 additions & 7 deletions R/draw-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,11 @@
##' m2 <- gam(y ~ s(x, z, k = 40), data = dat$data, method = "REML")
##' draw(m2, contour = FALSE)
##'
##' ## change the number of contours drawn
##' draw(m2, n_contour = 5)
##'
##' ## change the fill scale used for the surface
##' draw(m2,
##' continuous_fill = ggplot2::scale_fill_distiller(palette = "Spectral",
##' type = "div"))
##' ## change the number of contours drawn and the fill scale used for
##' ## the surface
##' draw(m2, n_contour = 5,
##' continuous_fill = ggplot2::scale_fill_distiller(palette = "Spectral",
##' type = "div"))
`draw.gam` <- function(object,
parametric = NULL,
select = NULL,
Expand Down
12 changes: 5 additions & 7 deletions man/draw.gam.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions tests/Examples/gratia-Ex.Rout.save
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,11 @@ Bivariate smoothing example
> m2 <- gam(y ~ s(x, z, k = 40), data = dat$data, method = "REML")
> draw(m2, contour = FALSE)
>
> ## change the number of contours drawn
> draw(m2, n_contour = 5)
>
> ## change the fill scale used for the surface
> draw(m2,
+ continuous_fill = ggplot2::scale_fill_distiller(palette = "Spectral",
+ type = "div"))
> ## change the number of contours drawn and the fill scale used for
> ## the surface
> draw(m2, n_contour = 5,
+ continuous_fill = ggplot2::scale_fill_distiller(palette = "Spectral",
+ type = "div"))
>
>
>
Expand Down Expand Up @@ -958,11 +956,11 @@ pmax(exp(eta), .Machine$double.eps)
> link(mod, parameter = "scale")
function (mu)
log(1/mu - 0.01)
<environment: 0x55981f09f640>
<environment: 0x56321bc18a08>
> inv_link(mod, parameter = "scale")
function (eta)
1/(exp(eta) + 0.01)
<environment: 0x55981f09f640>
<environment: 0x56321bc18a08>
>
>
>
Expand Down Expand Up @@ -1486,7 +1484,7 @@ detaching ‘package:mgcv’
> cleanEx()
> options(digits = 7L)
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
Time elapsed: 11.677 0.138 11.819 0.001 0.002
Time elapsed: 11.46 0.127 11.561 0.001 0.002
> grDevices::dev.off()
null device
1
Expand Down

0 comments on commit 1aa7c50

Please sign in to comment.