Mastering Matrix Manipulation: The Ultimate Guide To Rearranging Matrices In R