Can anyone tell me how to replace 0's with 1's and vice versa for a diagonal matrix in R.
If your matrix is mat and you want to flip all 1s as 0s...
mat <- 1-mat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With