It seems like it is almost always easier to work with a data.frame/tibble than a matrice.
If the matrix is not super big, it's easier just to pivot it longer, and then do whatever manipulation that you need with tidyverse functions, and then convert it back to a matrix if you need the output in a tiff format.
What do other people think? What are the situations where matrices are a more useful structure?