#' Coef method for linreg objects
#'
#' @description Extract coefficients from an object of the class "linreg".
#' @param object An object of class "linreg", generated by a call to \code{\link{linreg}}.
#' @param ... additional arguments.
#' @return A vector of coefficients.
#' @examples
#' linreg_obj <- linreg(Petal.Length~Species, datasets::iris)
#' coef(linreg_obj)
#' @export
coef.linreg <- function(object,...){
coefs <- as.vector(object$beta_hat)
names(coefs) <- row.names(object$beta_hat)
return(coefs)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.