#' Print out the estimated coeffiencts
#'
#' @description Estimated coeffiencts from an x of class "linreg".
#' @param x An object of Class "linreg", generated by a call to \code{\link{linreg}}.
#' @param ... additional arguments.
#' @return A list of estimated coeffiencts.
#' @examples
#' linreg_obj <- linreg(Petal.Length~Species, datasets::iris)
#' print(linreg_obj)
#' @export
print.linreg <- function(x,...) {
colnames(x$beta_hat) <- ""
cat("Call:", sep="\n")
cat("linreg(formula = ", x$y_name, " ", "~", " ", x$x_names, ", ","data = ", x$data_name, ")", sep = "")
cat(" ", sep = "\n")
cat("Coefficients:", sep="\n")
print(as.matrix(t(x$beta_hat)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.