% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/widget_gam.R
\name{widget_gam}
\alias{widget_gam}
\title{Alternative of \link[mgcv]{vis.gam}}
\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{
\item{...}{one or more \link[mgcv]{gam} models
based on \emph{a same data set}.}

\item{formula}{one-sided \link[stats]{formula}}

\item{newdata}{(for future expansion)}

\item{proj_xy}{\link[base]{logical} scalar, whether to show
the projection to the \eqn{(x,y)}-plain, default value is \code{TRUE}}

\item{proj_xz}{\link[base]{logical} scalar, whether to show
the projection to the \eqn{(x,z)}-plain, default value is \code{TRUE}}

\item{n}{\link[base]{integer} scalar, fineness of visualization,
default value is \code{501L}. See parameter \code{n.grid} of the function \link[mgcv]{vis.gam}.}

\item{newid}{\link[base]{integer} scalar or \link[base]{vector},
row indices of \code{newdata} to be visualized.
Default \code{1:2}, i.e., the first two test subjects.
Use \code{newid = NULL} to disable the visualization of \code{newdata}.}

\item{ylim}{\link[base]{length}-2 \link[base]{double} \link[base]{vector},
range on \eqn{q}-axis. Default is the range of \eqn{X} and \eqn{X^{\text{new}}} combined.}

\item{colorscale}{see function \link[plotly]{add_surface}}
}
\value{
The function \code{\link[=widget_gam]{widget_gam()}} returns a pretty \CRANpkg{htmlwidgets} created by \strong{R} package \CRANpkg{plotly}.
}
\description{
An interactive \CRANpkg{htmlwidgets} of the
\link[graphics]{persp}ective plot for
\link[mgcv]{gam} model(s)
using the package \CRANpkg{plotly}.
}
\note{
The maintainer is not aware of any functionality of projection of arbitrary curves in package \CRANpkg{plotly}.
Currently, the projections are hard coded.
}
\examples{
library(mgcv)
# ?s
# ?ti

}
\keyword{internal}
