From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

issymetric

issymetric

- [Instructor] Matrix math is a complex topic, and I'm not going to try to explain matrix math or why you'd need to use it. If you're using it, you understand it. The good thing is, is that R provides a rich set of tools for doing matrix math. One of them is the ability to find out if a matrix is symmetrical. Let's take a look at how issymetric works. In line three, I create a test matrix. Let's take a look at that matrix. In column one, I have one, and in column one, row two, I have two, in column two I have three, and then column two, row two, I have four. Now, is that symmetrical? In line five, I ask the question issymetric to test the matrix, and it comes back and says, no, that's not. Well, what does a symmetrical matrix look like? And in line seven, I've gone ahead and defined one. You can look at it here, there it is, zero-one-one-zero. In line nine, I use issymetric on test matrix to check is test matrix…

Contents