A typical example in which
diagonals can be helpful is Social Network
Analysis. For example, if we use matrices to represent friendship
perceptions between individuals, then we need a dyadic matrix.
Let says that we want to look at second-order connections (i.e. friends
of friends). If we now want to represent the data from both time period
in a single object, we need a 4-dimensional array. Higher-order arrays
are hard to visualise, another way of doing this is by representing two
dimensions along each of the two edges of a matrix. We can do this using
the Knonecker Product (denoted ⊗), which we can call in
Feelings of friendship towards oneself aren’t always particularly
insightful. We can now use the
diagonals library to eliminate those.
Subsequently the package can be loaded using:
The above demonstration is also available as a vignette that is included in the package.
It can be accessed from
For more information on the package and its development please see yesterday’s post diagonals on CRAN.