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

Description Usage Arguments Value Examples

View source: R/assessment.R

Description

Column match between two matrices by the minimum mean abosolute difference

Usage

1
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

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

davismcc/cardelino documentation built on Aug. 21, 2019, 3:31 p.m.