DEV Community


Discussion on: Excluding Diagonal Elements from a Matrix in R

skvrnami profile image
Michael Škvrňák

the diag function extracts, replaces diagonal of a matrix or creates a diagonal matrix so why don't you just use something like: any(diag(t))?

egimba profile image
Eric Gitonga Author

Thank you for that. I am just starting out learning, so I don't know much about it, thus my journey. I shall definitely explore that.