R-alpha: R-0.50.a1: buglet in lsfit()

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Mon, 28 Jul 1997 15:23:48 +0200


I just discovered why
	abline(lsfit(x, y))
does not produce any output (as I mentioned on Friday).  In lsfit(), the
coefficients output component was incorrectly named "coef" and not
"coefficients", hence the coefficients method returned NULL ...

The patch below fixes the problem.

-k

************************************************************************
*** src/library/base/funs/lsfit.orig	Sat Jul 26 09:38:47 1997
--- src/library/base/funs/lsfit	Sat Jul 26 09:39:46 1997
*************** lsfit <- function(x, y, wt=NULL, interce
*** 100,106 ****
  	}
  	z$qr <- as.matrix(z$qr)
  	colnames(z$qr) <- xnames
! 	output <- list(coef=z$coefficients, residuals=resids)
  
  	# if X matrix was collinear, then the columns would have been
  	# pivoted hence xnames need to be corrected
--- 100,106 ----
  	}
  	z$qr <- as.matrix(z$qr)
  	colnames(z$qr) <- xnames
! 	output <- list(coefficients=z$coefficients, residuals=resids)
  
  	# if X matrix was collinear, then the columns would have been
  	# pivoted hence xnames need to be corrected
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-