R/print.R

Defines functions print.linreg

Documented in print.linreg

#' Print information from a linreg object
#' @description \code{print} prints the formula and the coefficients from a linreg object.
#' @param x A linreg object.
#' @param ... Further arguments passed to or from other methods.
#' @return Prints the formula and the coefficients.
#' @examples
#' print(linreg(Petal.Length ~ Species, iris))
#' @export
#'

# print
print.linreg <- function(x, ...) {
  cat("\nCall:\n", deparse(x$call_arg), "\n\nCoefficients:\n", sep = "")
  # coef(x)
  res <- c(x$beta_hat)
  names(res) <- rownames(x$beta_hat)
  print(res)
}
Sidryd/lab4sidjac documentation built on Oct. 17, 2020, 11:05 p.m.