s-news
[Top] [All Lists]

Creating and merging factor levels

To: s-news@wubios.wustl.edu
Subject: Creating and merging factor levels
From: Gerald.Jean@spgdag.ca
Date: Mon, 25 Nov 2002 10:04:23 -0500
Hello S-users,

when creating factors is it possible to merge levels of a character
variable as the factor is created?  In other words can the following be
done in one operation.

ttt <- factor(ttt.char, levels = c("N", "O", "S")
ttt <- merge.levels(ttt, k = list(" Non" = "N",
                                  " Oui" = c("O", "S")))


Thanks,

Gérald Jean
Analyste-conseil (statistiques), Actuariat
télephone            : (418) 835-4900 poste (7639)
télecopieur          : (418) 835-6657
courrier électronique: gerald.jean@spgdag.ca

"In God we trust all others must bring data"  W. Edwards Deming


<Prev in Thread] Current Thread [Next in Thread>