Hi,
Under S-plus 6 on Win2000:
I'm removing rows from a data frame like this:
.drop<-X$ID=="C1234"
X<-X[!.drop,]
There are several factors in X and they all keep all
their original levels. I've tried to get rid of them by:
options(drop.unused.levels=T)
and
X<-X[!.drop,,drop=T]
but neither works. The best I can do is drop the
levels a factor at a time:
library(Hmisc,T)
X$ID<-factor(X$ID)
OR
X$ID<-"[.factor"(X,,drop=T)
but that's boring. Is there a way to get all the factors to
lose the superfluous levels automatically?
Thanks,
Bob Byers
Robert H. Byers, Jr. PhD
Statistics & Data Mgmt.
Div. of HIV-AIDS Prevention, CDC
bbyers@cdc.gov
(404) 639-2025
|