
Benjamin B. answered 06/21/19
Tutor
4.9
(35)
Ecologist with 4 years of R and research experience
You can pull out the r-squared value and p-value using the following code. The code for the p-value only works if you are creating a single-variable linear regression.
r-squared:
summary(fit)$r.squared
p-value:
summary(fit)$coefficients[2,4]