| Type: | Package |
| Title: | Generalized Additive Models with Hyper Column |
| Version: | 0.3.0 |
| Date: | 2026-05-17 |
| Description: | An interactive HTML widget of the perspective plot for generalized additive models. An alternative solution of the function mgcv::vis.gam(). |
| Encoding: | UTF-8 |
| License: | GPL-2 |
| Language: | en-US |
| URL: | https://github.com/tingtingzhan/hyper.gam, https://tingtingzhan-btaf430.netlify.app |
| Depends: | R (≥ 4.6) |
| Imports: | cli, mgcv, plotly |
| Suggests: | htmlwidgets |
| Config/roxygen2/version: | 8.0.0 |
| Config/roxygen2/markdown: | TRUE |
| NeedsCompilation: | no |
| Packaged: | 2026-05-17 11:34:42 UTC; tingtingzhan |
| Author: | Tingting Zhan |
| Maintainer: | Tingting Zhan <tingtingzhan@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-05-17 22:50:16 UTC |
hyper.gam: Generalized Additive Models with Hyper Column
Description
An interactive HTML widget of the perspective plot for generalized additive models. An alternative solution of the function mgcv::vis.gam().
Author(s)
Maintainer: Tingting Zhan tingtingzhan@gmail.com (ORCID)
Authors:
Tingting Zhan tingtingzhan@gmail.com (ORCID)
Other contributors:
Erjia Cui ecui@umn.edu (ORCID) (up to v0.2.3) [contributor]
See Also
Useful links:
Alternative of vis.gam
Description
An interactive htmlwidgets of the perspective plot for gam model(s) using the package plotly.
Usage
widget_gam(
...,
formula,
newdata = data,
proj_xy = TRUE,
proj_xz = TRUE,
n = 501L,
newid = seq_len(min(3L, nrow(newdata))),
ylim = range(X[is.finite(X)], newX[is.finite(newX)]),
surface_col = c("white", "lightgreen")
)
Arguments
... |
one or more gam models based on a same data set. |
formula |
one-sided formula |
newdata |
(for future expansion) |
proj_xy |
logical scalar, whether to show
the projection to the |
proj_xz |
logical scalar, whether to show
the projection to the |
n |
integer scalar, fineness of visualization,
default value is |
newid |
integer scalar or vector,
row indices of |
ylim |
length-2 double vector,
range on |
surface_col |
length-2 character vector, color of the integrand surface(s), for lowest and highest surface values |
Value
The function widget_gam() returns a pretty htmlwidgets created by R package plotly.
Note
The maintainer is not aware of any functionality of projection of arbitrary curves in package plotly. Currently, the projections are hard coded.
Examples
library(mgcv)
# ?gam
set.seed(2)
dat = gamSim(1, n = 400, dist = 'normal', scale = 2)
gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)