From ehlers at math.ucalgary.ca  Thu Nov  2 17:57:24 2006
From: ehlers at math.ucalgary.ca (ehlers at math.ucalgary.ca)
Date: Thu,  2 Nov 2006 17:57:24 +0100 (CET)
Subject: [Rd] buglet in plot.lm (PR#9333)
Message-ID: <20061102165724.27BFA3F202@slim.kubism.ku.dk>

In version 2.2.0, plot.lm() was enhanced with two new plots
(thanks, Martin and John).

There's a small fix needed for 'which=6' when 'id.n=0'.

 > plot(lm(rnorm(10) ~ 1), which = 6, id.n = 0)
Error in plot.lm(lm(rnorm(10) ~ 1), which = 6, id.n = 0) :
         could not find function "text.id"

Fixed by inserting braces in plot.lm.R:
Replace code at line last-8:

	if (id.n > 0)
	    show.r <- order(-cook)[iid]
	text.id(g[show.r], cook[show.r], show.r)

with

	if (id.n > 0) {
	    show.r <- order(-cook)[iid]
	    text.id(g[show.r], cook[show.r], show.r)
	}


 > version
                _
platform       i386-pc-mingw32
arch           i386
os             mingw32
system         i386, mingw32
status         Patched
major          2
minor          4.0
year           2006
month          10
day            29
svn rev        39744
language       R
version.string R version 2.4.0 Patched (2006-10-29 r39744)

Peter Ehlers




[Rd] buglet in plot.lm (PR#9333)
ehlers at math.ucalgary.ca