shine.qqGam | R Documentation |
This function takes the output of qq.gamViz and transforms it into an interactive shiny app.
## S3 method for class 'qqGam'
shine(o, ...)
o |
the output of qq.gamViz. |
... |
currently not used. |
In RStudio, this function returns a call to qq.gamViz
that reproduces the last plot
rendered in the interactive shiny window.
## Not run:
## simulate binomial data...
library(mgcv)
library(mgcViz)
set.seed(0)
n.samp <- 400
dat <- gamSim(1,n = n.samp, dist = "binary", scale = .33)
p <- binomial()$linkinv(dat$f) ## binomial p
n <- sample(c(1, 3), n.samp, replace = TRUE) ## binomial n
dat$y <- rbinom(n, n, p)
dat$n <- n
lr.fit <- gam(y/n ~ s(x0) + s(x1) + s(x2) + s(x3)
, family = binomial, data = dat,
weights = n, method = "REML")
lr.fit <- getViz(lr.fit)
# launch shiny gagdet
shine(qq(lr.fit))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.