Skip to content
Prev 166325 / 398502 Next

Two Noobie questions

On Thu, 8 Jan 2009, Neil Beddoe wrote:

            
You can, but it is easier not to fight R to do so.  Much more transsparent 
is:

cf <- coef(summary(<lm fit>)
cf[2,2] # index as a matrix.

You are

a) indexing a matrix as a vector
b) using [[]] on a numeric vector, which is unneded
c) indexing a list by number where indexing by name is simpler and using 
the extractor function coef() is even simpler.