#' Residuals method for linreg objects
#'
#' @description Residuals 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 residuals.
#' @examples
#' linreg_obj <- linreg(Petal.Length~Species, datasets::iris)
#' residuals(linreg_obj)
#' @export
residuals.linreg <- function(object,...){
e <- as.vector(object$e_hat)
return(e)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.