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