Re: subset

JOHN THADEN (JJTHADEN@LIFE.UAMS.EDU)
Mon, 19 Jan 1998 10:25:38 -0600 (CST)


Regarding my suggestion that the function subset.df() published previously
on the s-news mailing list might better be named subset.data.frame() and
operate as a method for a generic function subset(), Jens Oehlschlaegel
pointed out that a function subset() already is in use after having been
contributed to the s-news earlier. I then suggested that the existing
subset() might be dispensible. Jens responded,

>>I would like to keep the old subset() for efficiency, look at the
following:

> dim(basic)
[1] 1247 247
> dos.time(names(subset(basic,PAT==100)))
[1] 2.420006
> dos.time(names(df.subset(basic,PAT==100)))
[1] 19.06

Factor 8 is quite a differ
ence.

Also it can be an advantage, if factors are *not* automatically changed,
e.g. if you want to
tabulate empty categories also, or to get a warning on
empty categories rather than smoothly running an analysis you don't
really want.
<<

Jens, you have convinced me.

Regards,

John Thaden
University of ARkansas for Medical Sciences
Little Rock Arkansas USA