R/myconstr.R

Defines functions myconstr

Documented in myconstr

#' This is a constructor function.
#'
#'
#'This function will create a list output.
#'
#' @param x vector of independant data
#' @param y vector of dependant data
#'
#' @return a list of data and lm object
#' @export
#'
#' @examples
#' myconstr(x,y)
#'
myconstr = function(x, y){
  ylm = lm(y~x)
  obj = list(data = list(x = x, y = y), ylm = ylm)
  class(obj) = "constr"
  obj
}
ElahehJafarigol/R.Package.Stat documentation built on April 29, 2020, 12:25 a.m.