transpose_byname function

Transpose a matrix by name