label_matrix2: Create a Label Adjacency Matrix

View source: R/label_sim.R

label_matrix2R Documentation

Create a Label Adjacency Matrix

Description

Constructs a label adjacency matrix based on two sets of labels 'a' and 'b', creating edges depending on the 'type' parameter and the similarity function 'simfun'.

Usage

label_matrix2(
  a,
  b,
  type = c("s", "d"),
  simfun = NULL,
  dim1 = length(a),
  dim2 = length(b)
)

Arguments

a

A vector of labels for the first set of data points.

b

A vector of labels for the second set of data points.

type

A character specifying the type of adjacency matrix to create, either "s" for same labels or "d" for different labels (default: "s").

simfun

A function to determine the similarity between the labels (default: NULL). If NULL, the function will use "==" for type "s" and "!=" for type "d".

dim1

The dimension of the first set of data points (default: length(a)).

dim2

The dimension of the second set of data points (default: length(b)).

Value

A label adjacency matrix with edges determined by the label relationships between 'a' and 'b' and the similarity function 'simfun'.


bbuchsbaum/neighborweights documentation built on April 1, 2024, 8:41 p.m.