powered by
Convert vector to a bincode of 0/1 based on consecutive values in the vector.
convertVectToBinary(x)
Integer vector of same length than x.
x
Vector.
Laure Cougnaud
x <- c("group1", "group1", "group1", "group2", "group2", "group3", "group4", "group4") convertVectToBinary(x = x)
Run the code above in your browser using DataLab