long_to_cost_matrix: Build a cost matrix from source / target / cost columns

View source: R/utils.R

long_to_cost_matrixR Documentation

Build a cost matrix from source / target / cost columns

Description

The long-format door of lap_solve() and lap_solve_kbest(). Cells no row names are forbidden, which is what makes an absent pair an absent edge rather than a zero-cost one.

Usage

long_to_cost_matrix(source_vals, target_vals, cost_vals, forbidden = NA)

Value

List with the matrix and the source / target level vectors its row and column indices stand for.


couplr documentation built on Sept. 17, 2026, 1:08 a.m.