From Heather.Turner at warwick.ac.uk  Mon Dec 13 14:55:24 2004
From: Heather.Turner at warwick.ac.uk (Heather.Turner@warwick.ac.uk)
Date: Mon Dec 13 14:55:29 2004
Subject: [Rd] labels.lm (PR#7417)
Message-ID: <20041213135524.1378A1043E@slim.kubism.ku.dk>

Full_Name: Heather Turner
Version: 2.0.1
OS: Windows XP
Submission from: (NULL) (137.205.240.44)


labels.lm does not produce term labels for estimable terms as intended, e.g.
> example(lm)
> labels(lm.D9)
character(0)

The function code is as follows:
> labels.lm
function (object, ...) 
{
    tl <- attr(object$terms, "term.labels")
    asgn <- object$asgn[object$qr$pivot[1:object$rank]]
    tl[unique(asgn)]
}
<environment: namespace:base>

Replacing object$asgn with object$assign appears to solve the problem:
> labels.lm2 <- 
+ function (object, ...) 
+ {
+     tl <- attr(object$terms, "term.labels")
+     asgn <- object$assign[object$qr$pivot[1:object$rank]]
+     tl[unique(asgn)]
+ }  
> 
> labels.lm2(lm.D9)
[1] "group"


[Rd] labels.lm (PR#7417)
Heather.Turner@warwick.ac.uk