Message-ID: <16066.18174.638928.790645@gargle.gargle.HOWL>
Date: 2003-05-14T13:39:10Z
From: Martin Maechler
Subject: expand.grid
In-Reply-To: <200305032348.49124.gmm@ds.unifi.it>
>>>>> "Giovanni" == Giovanni Marchetti <gmm at ds.unifi.it>
>>>>> on Sat, 3 May 2003 23:48:48 +0000 writes:
Giovanni> I recently posted a question concerning an
Giovanni> inconsistency of expand.grid in defining the
Giovanni> reference level of the factors.
> > expand.grid(x = c("b", "a"), y = c(1, 2))$x
> [1] b a b a
> Levels: b a # reference level is b
> > expand.grid(x = c("b", "a"))$x
> [1] b a
> Levels: a b # reference level is a
Giovanni> Thank you very much for the ready explanations and
Giovanni> comments.
Giovanni> I found this inconsistency working with
Giovanni> contingency tables and logistic models.
Ciao Giovanni,
I've forgotten to tell you (and the audience) that this has been
chnaged in R-patched (to be 1.7.1) where
expand.grid(x1) and expand.grid(x1,x2) will be consistent.
Thank you for your posting!
Martin