#' 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.