Skip to content
Prev 323123 / 398502 Next

recode categorial vars into binary data

Maybe from help( data.frame)?

It's in most of the  examples and is not needed ...

 L3 <- LETTERS[1:3]
     (d <- data.frame(cbind(x=1, y=1:10), fac=sample(L3, 10, replace=TRUE)))
     
     ## The same with automatic column names:
     data.frame(cbind(  1,   1:10),     sample(L3, 10, replace=TRUE))
     

Chris