DEV Community

Discussion on: Excluding Diagonal Elements from a Matrix in R

Collapse
 
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))?

Collapse
 
egimba profile image
Eric Gitonga

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.