[Solved] Linear Regression in R – coef Function


Please read the help page before you post a question. ?coef says that:

coef is a generic function which extracts model coefficients from
objects returned by modeling functions

Therefore, you need to run a linear model using lm() on your data-set, then extract the coefficients from the model:

coef(lm(...))

solved Linear Regression in R – coef Function