Skip to content
Prev 334288 / 398502 Next

To transform a vector of qualitatives values into a dataframe of quantitatives values

Hi
What is A, B and C? If you expect them to be letters, they need to be in parentheses.
X <- sample(letters[1:3], 10, replace=T)
X
 [1] "c" "c" "a" "b" "c" "c" "a" "a" "a" "a"
data.frame(A=(X=="a"), B=(X=="b"), C=(X=="c"))

Petr