From rmh at temple.edu  Thu Oct  8 04:40:12 2009
From: rmh at temple.edu (rmh at temple.edu)
Date: Thu,  8 Oct 2009 04:40:12 +0200 (CEST)
Subject: [Rd] bug inside plot.lm (PR#13989)
Message-ID: <20091008024012.89AF9282EFFB@mail.pubhealth.ku.dk>

The function
     getCaption <- function(k) as.graphicsAnnot(unlist(caption[k]))
inside plot.lm in R-2.9.2 and R-2.10.0alpha loses the expression
for caption 6.  From a recover() inside the function

Browse[1]> caption[6]
[[1]]
expression("Cook's dist vs Leverage  " * h[ii]/(1 - h[ii]))

Browse[1]> caption[[6]]
expression("Cook's dist vs Leverage  " * h[ii]/(1 - h[ii]))
Browse[1]> getCaption(6)
[[1]]
"Cook's dist vs Leverage  " * h[ii]/(1 - h[ii])

Browse[1]> as.graphicsAnnot(caption[[6]])
expression("Cook's dist vs Leverage  " * h[ii]/(1 - h[ii]))


The repair seems to be to redefine getCaption as follows

Browse[1]> getCaption <- function(k) as.graphicsAnnot(caption[[k]])
Browse[1]> getCaption(6)
expression("Cook's dist vs Leverage  " * h[ii]/(1 - h[ii]))
Browse[1]>

Rich



[Rd] bug inside plot.lm (PR#13989)
rmh at temple.edu