# returns a permutation matrix: m=n, all the nodes get matched
corr <- data.frame(corr_A = c(1,2,3,4), corr_B = c(1,4,2,3))
get_perm_mat(corr, c(4, 4))
# submatrix is a permutation matrix: parts of graphs get matched
get_perm_mat(corr, c(5, 6))
Run the code above in your browser using DataLab