R/random.R

#' @rdname gam.random
#' @export random
"random" <-
    function (f, df = NULL, lambda = 0, intercept = TRUE)
{
    scall <- deparse(sys.call())
    if (!inherits(f, "factor"))
        stop("random() expects a factor or category as its first argument")
    newf=rep(0,length(f))
    attr(newf,"values")=f
    attr(newf, "call") <- substitute(gam.random(data[[scall]], z,
                                             w, df = df, lambda = lambda, intercept = intercept))
    oldClass(newf) <- "smooth"
    newf
}

Try the gam package in your browser

Any scripts or data that you put into this service are public.

gam documentation built on March 31, 2023, 9:10 p.m.