Hi,
I have a problem excluding factor levels.
factor allows an "exclude" argument to avoid some values to form levels:
factor(letters[1:5])
[1] a b c d e
factor(letters[1:5],exclude="b")
[1] a NA c d e
When x already is a factor, this doesn't work:
x<-factor(letters[1:5])
factor(x,exclude="b")
[1] a b c d e
Warning messages:
1 missing values generated coercing from character to integer in:
storage.mode(exclude) <- storage.mode(levels)
factor converts storage mode of the exclude argument from character to
integer, the storage mode for a factor, and the values are lost.
--
Victor Moreno
Servei d'Epidemiologia i Registre del Cancer
Institut Catala d'Oncologia
Gran Via km 2.7, 08907 Hospitalet, Barcelona, Spain
Tel: + 34 93260 7434 / 7401 / 7812 fax +34 93260 7787
|