[R] problem with model.matrix

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Jun 25 08:06:42 CEST 2004

On Fri, 25 Jun 2004, Berwin A Turlach wrote:

> >>>>> "BN" == Balasubramanian Narasimhan <naras at stanford.edu> writes:
>     BN> Trevor's problem is reproducible on R 1.8.1 (which is what he
>     BN> was using) on both Linux RHEL 3.0 and Solaris and R 1.8.0 on
>     BN> Windows.
> Yep, on my Linux box (details below) I have the same problem with R
> 1.8.1 but no problem under R 1.9.0 or R 1.9.1.
> Time to upgrade I would say. :)

Here is the reason (NEWS for 1.9.0)

    o	contrasts() turns a logical variable into a factor.  This now
	always has levels c("FALSE", "TRUE") even if only one (or
	none) of these occur in the variable.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list