Learn R Programming

LICORS (version 0.2.0)

states2weight_matrix: Converts label vector to 0/1 mixture weight matrix

Description

Converts unique cluster assignment stored in a length \(N\) label vector into a \(N \times K\) Boolean matrix of mixture weights.

Usage

states2weight_matrix(states, num.states.total = NULL)

Arguments

states

a vector of length \(N\) with the state labels

num.states.total

total number of states. If NULL, then the maximum of states is chosen

See Also

weight_matrix2states

Examples

Run this code
# NOT RUN {
ss <- sample.int(5, 10, replace = TRUE)
WW <- states2weight_matrix(ss)

image2(WW, col = "RdBu", xlab = "States", ylab = "Samples", axes = FALSE)
# }

Run the code above in your browser using DataLab