Generate some data

x <- 1:100
y <- x + 10*rnorm(100)
plot(y~x)

Create Linear model

mod <- lm(y~x)
plot(y~x)
abline(mod)

Regression output

summary(mod)
## 
## Call:
## lm(formula = y ~ x)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -20.0063  -6.4170  -0.8657   6.4988  22.8890 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.40972    1.97525   0.207    0.836    
## x            1.00399    0.03396  29.566   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.802 on 98 degrees of freedom
## Multiple R-squared:  0.8992, Adjusted R-squared:  0.8982 
## F-statistic: 874.1 on 1 and 98 DF,  p-value: < 2.2e-16

Grabbing the coefficients

mod$coef[1]
## (Intercept) 
##   0.4097155
mod$coef[2]
##        x 
## 1.003993