binary_label_matrix | R Documentation |
Constructs a binary adjacency matrix based on two sets of labels 'a' and 'b', creating edges when 'a' and 'b' have the same or different labels, depending on the 'type' parameter.
binary_label_matrix(a, b = NULL, type = c("s", "d"))
a |
A vector of labels for the first set of data points. |
b |
A vector of labels for the second set of data points (default: NULL). If NULL, 'b' will be set to 'a'. |
type |
A character specifying the type of adjacency matrix to create, either "s" for same labels or "d" for different labels (default: "s"). |
A binary adjacency matrix with edges determined by the label relationships between 'a' and 'b'.
data(iris)
a <- iris[,5]
bl <- binary_label_matrix(a, type="d")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.