R/slm_s.R

#' Fit a Simple Linear Regression Model
#'
#'
#' @description This is a function to conduct simple linear regression model on two continues variable
#' @param data a dataframe
#' @param x    the independent variable on x axis
#' @param y    the dependent variable on y axis
#'
#' @return     summary of the model
#' @export
#' @importFrom stats lm
#' @author Yunrou Gong
#' @seealso \code{\link{slm_log}}
#'
#' @examples
#' slm_s(sleepdata, "Tempreture", "SleepDuration")
slm_s <- function(data, x, y){
  model = lm(data[[y]]~data[[x]])
  return(summary(model))

}
poorbaby/r_package_sha documentation built on May 29, 2019, 7:38 a.m.