[R] Extracting Number from Output of Coef()

Peter Lauren peterdlauren at yahoo.com
Sun Nov 11 20:52:17 CET 2007


I obtain the coefficients of a nonlinear function
thus.
------------------------------------------
m=nls(y ~ a + b*x + c*x^2 + d*x^3 +
e*exp(x)+f*log(x)+g*log2(x), start = list(a = 0, b =
1, c = 1, d=1, e=1, f=1, g=1))

c=coef(m)
-------------------------------------------

However, when I look at c[1], I get something like
a
2.345678

How can I extract 2.345678 as a number?

Thanks very much in advance,
Peter.



More information about the R-help mailing list