Skip to contents

Get a list of matrix diagonals

Usage

get_diagonal2(m, corner = c("tl", "tr", "bl", "br"))

Arguments

m

A square matrix

corner

A coner where the diagonal should start from

Value

A list of vectors

Details

The returned vectors all start on the top or bottom of the original matrix. If opposing corners (eg top left and bottom right) are chosen, then the longest vector from the bottom corner will be dropped because it is a duplicate of the longest from the top.