e.g. row 1 of mat1 will be correlated with row 1 of mat2; row 2 of mat 1 with row 2 of mat2, etc.

pair_cor(mat1, mat2, margin = 1)

Arguments

mat1

a numeric matrix for correlation

mat2

a second numeric matrix for correlation

margin

1 for rows, 2 for columns (as for the MARGIN parameter of apply())

Value

a numeric vector with paired correlation values

Details

The matrices must have the same number of rows or columns