Description Usage Arguments See Also Examples
View source: R/states2weight_matrix.R
Converts unique cluster assignment stored in a length N label vector into a N \times K Boolean matrix of mixture weights.
1 | 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
|
1 2 3 4 | ss <- sample.int(5, 10, replace = TRUE)
WW <- states2weight_matrix(ss)
image2(WW, col = "RdBu", xlab = "States", ylab = "Samples", axes = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.