[Rd] For wishlist: sanity checks for subsets in lm, glm (PR#

Prof Brian Ripley Prof Brian Ripley <ripley@stats.ox.ac.uk>
Wed, 12 Apr 2000 13:54:57 +0100 (BST)


> From: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
> Date: 12 Apr 2000 13:18:37 +0200
> 
> Martyn Plummer <plummer@iarc.fr> writes:
> 
> > On 12-Apr-00 Peter Dalgaard BSA wrote:
> > > Might be a good idea. Mind you, Splus 3.4 does exatly the same thing,
> > > and I'm a little worried that the uniqueness assumption might kill
> > > some bootstrapping applications:
> > > 
> > >  glm(y ~ x, data=test.data, subset=sample(seq(along=y),replace=T))
> > 
> > Splus 5.1 doesn't do this, because it preserves logical vectors in
> > data frames (but then perhaps comparisons with S4 or SPlus 5.x are
> > irrelevant?)
> 
> They're sometimes relevant because they show what has been considered
> a bug in 3.x... The convert-to-factor conventions in 3.x (and R) are
> quite a bit of a pain in my opinion, but I'm afraid we're stuck with
> them at least for the near future (we couldn't make an API change as
> pervasive as that without bumping the major version number). 

I would argue for changing the behaviour of converting logicals for 1.1.
It's a rare case, breaks almost nothing (as evidenced by the lack
of problems with S-PLUS 5.x) and would be helpful. Character vars
are another matter.

> > I knew there would be a good reason not to implement this. My feeling
> > is that high level modelling functions should protect the  user as
> > much as possible. If you want more flexibility, you can always
> > program around it.
> 
> Maybe, but... Getting people to program around S/R differences in
> their add-on packages haven't always been unproblematic.
> 
> What would also catch your case would be to disallow factors as subset
> variables, and I can't think of any situation where subsetting with a
> factor would occur naturally. Does 5.1 allow subsetting with factors?

Yes, exactly as before.

-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._