Skip to content
Prev 11134 / 398502 Next

Coding categorical -> dummy

Dear R-Users,

I have a data frame with several categorical variables. I want to code
these variables in dummy variables keeping all levels.
I know the function model.matrix (see below) but it works only for one
categorical variable :
Is there anyone who have write such function ?
Thanks for your help.

Samir Messad


Samir Messad    E-Mail : messad at cirad.fr
Statisticien
CIRAD-EMVT
TA 30/A
Programme Productions Animales
Campus de Baillarguet
34398 Montpellier cedex 5 (France)

T?l :  +33 (0)4-67-59-38-44
Fax : +33 (0)4-67-59-38-25
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._