colMatch: Column match between two matrices by minimum mean absolute...

View source: R/assessment.R

colMatchR Documentation

Column match between two matrices by minimum mean absolute difference

Description

Column match between two matrices by minimum mean absolute difference

Usage

colMatch(A, B, force = FALSE)

Arguments

A

The first matrix which will be matched

B

The second matrix, the return index will be used on

force

bool(1), If TRUE, force traversing all permutations of B to find the optimised match to A with computing cost of O(n!). Otherwise, use greedy search with computing cost of O(n^2).

Value

idx, the column index of B to be matched to A

Examples

matA <- matrix(sample(seq(12)), nrow = 3)
col_idx <- sample(4)
matB <- matA[, col_idx]
colMatch(matB, matA)

PMBio/cardelino documentation built on Nov. 21, 2022, 4:52 a.m.