Get all row vectors of a matrix.

This function extracts all surrounding elements of a specified element in a matrix and returns the result as a vector.

1 | ```
get_surround(data, index, type = "all")
``` |

`data` |
Matrix. |

`index` |
Index position of element. Input as a vector of row then column positions. |

`type` |
Takes values of "direct" and "all". "direct" returns only the elements directly in contact with the specified element, whereas "all" returns every surrounding element including diagonals. Defaults to "all". |

1 2 | ```
M = matrix(1:20,4,5)
get_surround(data = M, index = c(2,3))
``` |

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

Please suggest features or report bugs with the GitHub issue tracker.

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