R/pred.linreg.R

Defines functions pred.linreg

Documented in pred.linreg

#' Return predictions of a linreg object
#' @description \code{pred} returns the predictions of a linreg object.
#' @param object A linreg object.
#' @param ... Further arguments passed to or from other methods.
#' @return Return a named vector with predictions.
#' @examples
#' pred(linreg(Petal.Length ~ Species, iris))
#' @export
#'
# pred
pred.linreg <- function(object, ...){
  res <- c(object[[5]])
  names(res) <- rownames(object[[5]])
  return(res)
}
Sidryd/lab4sidjac documentation built on Oct. 17, 2020, 11:05 p.m.