| Type: | Package |
| Title: | Generalized Additive Models with Hyper Column |
| Version: | 0.3.3 |
| Date: | 2026-08-25 |
| Description: | An interactive HTML widget of the perspective plot for generalized additive models; an alternative solution of the function mgcv::vis.gam(). This R package author has retired from academic research. Accordingly, this package should not be considered a validated tool for use in peer-reviewed publications or as the basis for grant applications. Backward compatibility with user-code published in <doi:10.1093/bioinformatics/btaf182> and <doi:10.1093/bioinformatics/btaf430> is not maintained in versions >= 0.3.0 (June 2026) of this package. The authors of those publications are the appropriate contacts for reproducibility inquiries. |
| Encoding: | UTF-8 |
| License: | GPL-2 |
| Language: | en-US |
| Depends: | R (≥ 4.6) |
| Imports: | cli, mgcv, plotly |
| Suggests: | htmlwidgets |
| Config/roxygen2/version: | 8.1.0 |
| Config/roxygen2/markdown: | TRUE |
| NeedsCompilation: | no |
| Packaged: | 2026-08-25 18:49:22 UTC; tingtingzhan |
| Author: | Tingting Zhan [aut, cre],
Erjia Cui |
| Maintainer: | Tingting Zhan <tingtingzhan@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-08-25 22:10:02 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(). This R package author has retired from academic research. Accordingly, this package should not be considered a validated tool for use in peer-reviewed publications or as the basis for grant applications. Backward compatibility with user-code published in doi:10.1093/bioinformatics/btaf182 and doi:10.1093/bioinformatics/btaf430 is not maintained in versions >= 0.3.0 (June 2026) of this package. The authors of those publications are the appropriate contacts for reproducibility inquiries.
Note
This R package author has retired from academic research.
Accordingly, this package should not be considered a validated tool for use in peer-reviewed publications or as the basis for grant applications.
Backward compatibility with user-code published in the following publications is not maintained in versions >= 0.3.0 of this package. The authors of those publications are the appropriate contacts for reproducibility inquiries.
doi:10.1093/bioinformatics/btaf182
doi:10.1093/bioinformatics/btaf430
Author(s)
Maintainer: Tingting Zhan tingtingzhan@gmail.com
Authors:
Tingting Zhan tingtingzhan@gmail.com
Other contributors:
Erjia Cui ecui@umn.edu (ORCID) (up to v0.2.3) [contributor]
Trace on gam Model
Description
Trace on the surface of a gam model.
Usage
trace_gam(
object,
formula,
newdata = data,
newid = seq_len(min(3L, nrow(newdata))),
...
)
Arguments
object |
a gam model |
formula |
one-sided formula |
newdata |
data.frame, the test set |
newid |
integer scalar or vector,
row indices of |
... |
additional parameters, to be passed into the function plot_ly |
Value
The function trace_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.
Examples
library(mgcv)
# ?s
# ?ti
Alternative perspective Plot for gam Model
Description
An interactive perspective plot for gam model, rendered as an htmlwidgets using the package plotly.
Usage
widget_gam(x, ..., colorscale)
Arguments
x |
a gam model |
... |
parameters of the function vis.gam |
colorscale |
to be passed into the function add_surface |
Value
The function widget_gam() returns a pretty htmlwidgets created by R package plotly.
Note
The internal utility functions persp_gam_int() and newd_gam_int() are based on the function vis.gam.
Examples
library(mgcv)
colorscale = list(c(0, 1), c('white', 'lightgreen'))
# examples from ?mgcv::te
test1 = \(x,z,sx=0.3,sz=0.4) {
x = x*20
(pi**sx*sz)*(1.2*exp(-(x-0.2)^2/sx^2-(z-0.3)^2/sz^2)+
0.8*exp(-(x-0.7)^2/sx^2-(z-0.8)^2/sz^2))
}
n = 500
x = runif(n)/20; z = runif(n);
xs = seq(0,1,length=30)/20; zs = seq(0,1,length=30)
pr = data.frame(x=rep(xs,30),z=rep(zs,rep(30,30)))
truth = matrix(test1(pr$x,pr$z),30,30)
persp(xs,zs,truth); title("truth")
f = test1(x,z)
y = f + rnorm(n)*0.2
b1 = gam(y ~ s(x,z))
b2 = gam(y ~ te(x,z))
b3 = gam(y ~ ti(x) + ti(z) + ti(x,z))
b4 = gam(y ~ ti(x) + ti(x,z,mc=c(0,1))) ## note z constrained!
widget_gam(b1, colorscale = colorscale)
widget_gam(b2, colorscale = colorscale)
widget_gam(b3, colorscale = colorscale)
widget_gam(b4, colorscale = colorscale)