I have two matrices and I would like to change a part of the bigger one with the smaller one.
So this is the first and this is the second matrix:
Bigger matrix:
matrix1=matrix(1:36,nrow=6,ncol=6)
Smaller matrix:
matrix2=matrix(1:10,nrow=2,ncol=5)
And by merging them the result should be somethink like this:
[,1] [,2][,3] [,4] [,5][,6]
[1,] 1 7 13 19 25 31
[2,] 2 8 14 20 26 32
[3,] 3 9 15 21 27 33
[4,] 1 3 5 7 9 34
[5,] 2 4 6 8 10 35
[6,] 6 12 18 24 30 36
where just a part of the result matrix has the smaller one inside the bigger one at a specific part.