Skip to content

bug inside plot.lm (PR#13989)

1 message · Richard M. Heiberger

#
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