[R] To transform a vector of qualitatives values into a dataframe of quantitatives values

Arnaud Michel michel.arnaud at cirad.fr
Wed Dec 11 14:00:41 CET 2013


Hi

 From the vector
X <- c(A, A, B, C, B, A, C)

I would like to build the Dataframe :
data.frame( A=c(1,1,0,0,0,1,0), B=c(0,0,1,0,1,0,0), C=c(0,0,0,1,0,0,1))

Any ideas ?


-- 
Michel ARNAUD
Chargé de mission auprès du DRH
DGDRD-Drh - TA 174/04
Av Agropolis 34398 Montpellier cedex 5
tel : 04.67.61.75.38
fax : 04.67.61.57.87
port: 06.47.43.55.31



More information about the R-help mailing list