![Swap elements in binary matrices](https://blogs.sas.com/content/iml/files/2019/12/binarymat3.png)
Binary matrices are used for many purposes. I have previously written about how to use binary matrices to visualize missing values in a data matrix. They are also used to indicate the co-occurrence of two events. In ecology, binary matrices are used to indicate which species of an animal are