R/get_coefficients.R

Defines functions getCoefficients

Documented in getCoefficients

#' getCoefficients
#' @title Get Coefficients
#' @description Get coefficients from the model summary
#' @param model lm model
#' @author Jayachandra N
#' @return data.frame of coeffcients
#' @export
#' @examples
#'  model <- lm(Sepal.Length ~ ., iris) # A linear regression model
#'  getCoefficients(model)
getCoefficients <- function(model) {
  x <- summary(model)
  y <- x$coefficients
  x <- data.frame(Col = row.names(y), y)
  return(x)
}

Try the shinyr package in your browser

Any scripts or data that you put into this service are public.

shinyr documentation built on Oct. 21, 2021, 5:07 p.m.