This function extracts all diagonal vectors of a matrix and returns the result as a list.

1 |

`data` |
Matrix from which to extract diagonal elements |

`direction` |
Which side to begin on? Takes values of one of "left", "right" or "both". Defaults to "right". |

1 2 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.