> a=lm(w$x2~1+w$x1)
> a
Call:
lm(formula = w$x2 ~ 1 + w$x1)
Coefficients:
(Intercept) w$x1
14.905 1.037
> z=data.frame("w$x1"=72)
> predict(a,z)
1 2 3 4 5 6 7
26.31005 108.22181 66.74750 39.78920 43.31452 17.18570 15.01867
8 9 10 11 12 13 14
100.96381 118.59039 77.11608 46.01035 51.19463 19.57047 14.96682
Warning message:
'newdata' had 1 row but variables found have 14 rows