R/print_ridgereg.R

Defines functions print.ridgereg

Documented in print.ridgereg

#' Print out the estimated coeffiencts 
#' 
#' @description Estimated coeffiencts from an x of class "ridgereg".
#' @param x An object of Class "ridgereg", generated by a call to \code{\link{ridgereg}}.
#' @param ... additional arguments.
#' @return A list of estimated coeffiencts.
#' @examples 
#' ridgereg_obj <- ridgereg(Petal.Length~Species, datasets::iris)
#' print(ridgereg_obj)
#' @export

print.ridgereg <- function(x,...) {
  colnames(x$coef) <- ""
  
  cat("Call:", sep="\n")
  cat("ridgereg(formula = ", x$y_name, " ", "~", " ", x$x_names, ", ","data = ", x$data_name, ")", sep = "")
  cat(" ", sep = "\n")
  cat("Coefficients:", sep="\n")
  print(as.matrix(t(x$coef)))
}
hugkn566/Lab4HugoOtto documentation built on Oct. 20, 2020, 2:17 p.m.