From m@echler @ending from @t@t@m@th@ethz@ch  Wed Jul 18 15:40:53 2018
From: m@echler @ending from @t@t@m@th@ethz@ch (Martin Maechler)
Date: Wed, 18 Jul 2018 15:40:53 +0200
Subject: [Rd] Tiny bug in lm()?
In-Reply-To: <87h8lscpgf.fsf@ufl.edu>
References: <87in68cuyp.fsf@ufl.edu>
	<87h8lscpgf.fsf@ufl.edu>
Message-ID: <23375.17253.421709.832356@stat.math.ethz.ch>

>>>>> Brett Presnell 
>>>>>     on Sun, 24 Jun 2018 13:57:04 +0100 writes:

    > I meant ncol(y) of course.

    > Brett Presnell <presnell at ufl.edu> writes:

    >> I suppose that this never affects anything, but in line
    >> 57 of lm.R, where the coefficients are defined for an
    >> empty model, when y is a matrix, shouldn't the value be
    >> matrix(,0,nrow(y)) rather than matrix(,0,3)?

Yes ("ncol(y)") and actually it should be 'double', not
'logical'.

OTOH: Multivariate empty models are probably pretty rare, so no
      wonder this has never been reported the last 13.374 years
      this has been in the sources.

Of course, I will still fix it.  Thank you, Brett, for reporting!

Martin



[Rd] Tiny bug in lm()?
Martin Maechler