[R] Recoding factors

Chuck Cleland ccleland at optonline.net
Mon Oct 18 13:46:34 CEST 2004

   See ?levels.  I think you want something like the following:

levels(myfact) <- c("Singleton", "Multiple", "Multiple")

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?

Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894

More information about the R-help mailing list