Convert one-hot encoded matrix to factor
Usage
one_hot2factor(x, labels = colnames(x))
Examples
if (FALSE) { # \dontrun{
x <- data.frame(matrix(F, 10, 3))
colnames(x) <- c("Dx1", "Dx2", "Dx3")
x$Dx1[1:3] <- x$Dx2[4:6] <- x$Dx3[7:10] <- T
one_hot2factor(x)
} # }