I have a dataframe like this
L1 L2 L3 L4 L5
A 1 2 3 4 5
B 1 2 4 3 5
C 1 3 3 2 1
I want to calculate the number of differences between rows, for example the number of differences between A and B is 2, A and C is 3, B and C is 4.
What I really want is a difference matrix, such as
A B C
A 0 2 3
B 2 0 4
C 3 4 0