Yes that's it.

Thanks
Neil

On 18/10/2004, at 7:57 PM, Prof Brian Ripley wrote:

On Mon, 18 Oct 2004, Uwe Ligges wrote:

Neil Leonard wrote:

I'm having a bit of trouble recoding factors in a fields.

I have a field which has the factors Singleton, Twin and Triplet.
I want to recode the field to have only the factors Singleton and Multiple.


Any advice?

Depends on what you are going to do with the Twin ...

?levels should help, though.

x <- factor(c("Singleton", "Twin", "Triplet"))
levels(x) <- c("Singleton", "Multiple", "Multiple")
x
[1] Singleton Multiple  Multiple
Levels: Singleton Multiple

might be what is intended.

--
Brian D. Ripley,                  [EMAIL PROTECTED]
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to