label_matrix | R Documentation |
Calculates a similarity or distance matrix between two categorical label vectors 'a' and 'b'.
label_matrix(
a,
b,
type = c("s", "d"),
return_matrix = TRUE,
simfun = NULL,
dim1 = length(a),
dim2 = length(b)
)
a |
The first categorical label vector. |
b |
The second categorical label vector. |
type |
The type of matrix to construct, either a similarity ('s') or distance ('d') matrix. |
return_matrix |
A logical flag indicating whether to return the result as a sparse matrix (default: TRUE) or a triplet. |
simfun |
An optional user-provided similarity function. If not provided, a default similarity function will be used. |
dim1 |
The length of the first dimension. |
dim2 |
The length of the second dimension. |
A similarity or distance matrix between the categorical label vectors 'a' and 'b', either as a sparse matrix or a triplet.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.