Converts label vector to 0/1 mixture weight matrix
Converts unique cluster assignment stored in a length N label vector into a N \times K Boolean matrix of mixture weights.
states2weight_matrix(states, num.states.total = NULL)
states |
a vector of length N with the state labels |
num.states.total |
total number of states. If
|
ss <- sample.int(5, 10, replace = TRUE) WW <- states2weight_matrix(ss) image2(WW, col = "RdBu", xlab = "States", ylab = "Samples", axes = FALSE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.