R/as.anova.R

#' @export
"as.anova" <-
  function(df, heading)
{
  if(!inherits(df, "data.frame"))
    stop("df must be a data frame")
  attr(df, "heading") <- heading
                                        #if the "class" attribute of df already starts with "anova" return(df)
  if(inherits(df, "anova")) {
    dfClasses <- attr(df, "class")
    if(dfClasses[1] == "anova")
      return(df)
  }
  class(df) <- unique(c("anova", class(df)))
  df
}

Try the gam package in your browser

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

gam documentation built on Sept. 13, 2024, 1:06 a.m.