Dear R developers,
I was looking for a function analogous to base::diag() for getting and
setting bands of a matrix. The closest I could find was Matrix::band(),
but this was not exactly what I wanted for two reasons. Firstly,
Matrix::band() returns a matrix rather than just the specified
Thanks for the suggestion, Martin!
I looked at both Matrix::band and Matrix::bandSparse. Maybe I
misunderstand the help pages and the examples, but from what I can see
neither of them provides the functionality I was looking for.
For the getter version of the function I was looking for, I