colMatch | R Documentation |
Column match between two matrices by minimum mean absolute difference
colMatch(A, B, force = FALSE)
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). |
idx
, the column index of B to be matched to A
matA <- matrix(sample(seq(12)), nrow = 3) col_idx <- sample(4) matB <- matA[, col_idx] colMatch(matB, matA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.