Package {hyper.gam}


Type: Package
Title: Generalized Additive Models with Hyper Column
Version: 0.3.1
Date: 2026-06-13
Description: An interactive HTML widget of the perspective plot for generalized additive models. An alternative solution of the function mgcv::vis.gam(). The 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.
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-06-13 22:30:08 UTC; tingtingzhan
Author: Tingting Zhan ORCID iD [aut, cre], Erjia Cui ORCID iD [ctb] (up to v0.2.3)
Maintainer: Tingting Zhan <tingtingzhan@gmail.com>
Repository: CRAN
Date/Publication: 2026-06-13 22:40: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(). The 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.

Author(s)

Maintainer: Tingting Zhan tingtingzhan@gmail.com (ORCID)

Authors:

Other contributors:

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)]),
  colorscale
)

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 (x,y)-plain, default value is TRUE

proj_xz

logical scalar, whether to show the projection to the (x,z)-plain, default value is TRUE

n

integer scalar, fineness of visualization, default value is 501L. See parameter n.grid of the function vis.gam.

newid

integer scalar or vector, row indices of newdata to be visualized. Default 1:2, i.e., the first two test subjects. Use newid = NULL to disable the visualization of newdata.

ylim

length-2 double vector, range on q-axis. Default is the range of X and X^{\text{new}} combined.

colorscale

see function add_surface

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)
# ?s
# ?ti

mirror server hosted at Truenetwork, Russian Federation.